This site requires JavaScript, please enable it in your browser!
Greenfoot
Username
Password
Remember Me?
Sign Up, Lost Password
Activity
About
Documentation
Download
Discuss
Scenarios
Discussions
You need to login to take part
Current Discussions
PLEASE HELP?
By Serhil, with 8 replies.
Last reply by Serhil, about 13 years ago:
yess thankss now it works perfect :D
Changing Colors
By theDoctor, with 6 replies.
Last reply by danpost, about 13 years ago:
In your act() method for the Ball, you have a section that already starts like the following, but this is what I believe you need after you add 'brickColor' to the Brick class.. <Code Omitted>
Arrays in Greenfoot
By Klaus, with 6 replies.
Last reply by ttamasu, about 13 years ago:
Arrays are simple collection of objects of the same type (where all decendents of an object can be considered the same type .. like all subclasses of Actor). Typically, you declare an array like so: Base_Type Array_Name = new Base_Type; where Base_Type is the class name like Actor, String,etc Array_name is any legal java name length is the size of the array you what to create eg. String names =new String; // creates an empty array with 10 slots starting at 0 and going to 9 Or you can initialize the values at the time of de
Second array?
By Tomc84, with 7 replies.
Last reply by Duta, about 13 years ago:
What your teacher is suggesting sounds a bit like a bubble sort - if that is what he's getting at, I can provide code. It is, however, a very inefficient sorting method
What is the general code for a sidescrolling game?
By MakerOfGames, with 2 replies.
Last reply by JayWood860, about 13 years ago:
for vertical scrolling, would you replace all X's with Y's and all Width's with Height's?
wait();
By Drew, with 5 replies.
Last reply by Duta, about 13 years ago:
davmac wrote...
As a matter of style I would also include the { }s after the 'for' even though it is not strictly necessary in this case. The technique will interfere a little with Greenfoot's input handling (keyboard/mouse) though it might be ok for some scenarios. Finally, this technique will only work with one actor - once another one tries to do the same thing, strange things may start to happen (actor A will make actor B act, and actor B will then try to make actor A act).
Oh fair point, I hadn't thought about the possible recursiveness of it. I suppose you could have a List of ac
SENIORPROJECT:Recyclingpaperballgame.byGava. NEED a lil help haha
By OGava, with 3 replies.
Last reply by OGava, about 13 years ago:
thx, lol
Set to same level - why does this not work?
By PStigerID, with 3 replies.
Last reply by danpost, about 13 years ago:
Just create a world constructor to recieve the actor. Example (still using 'Arena', and adding actor Player class 'player'): 'Greenfoot.setWorld(new Arena(player));'.
Won't Publish or Export
By xillius200, with 2 replies.
Last reply by xillius200, about 13 years ago:
Thanks for the help :) yep it was to do with file access xD it hated getting images from another folder such as /smurf/smurf1.png once I had exported it xD so stuck images back in /images/ instead of /images/smurf/ and it worked perfect ^^
Letter game constructor confusion
By chris4800, with 2 replies.
Last reply by chris4800, about 13 years ago:
That's it! Thank you for explaining that. It seems so obvious now haha. Thanks again. It is much appreciated!
Someone help me fix this problem
By 2patrickMurphy, with 7 replies.
Last reply by 2patrickMurphy, about 13 years ago:
ok thanks thats a much easier fix and ill make all nessciary corrections later when we combine our pieces.
...what am I doing wrong? :(
By Omniscience, with 18 replies.
Last reply by danpost, about 13 years ago:
One thing is: you are storing the possible submitted responses in String variables, and then trying to ask if they hold a value of 'true'. Another thing: you are using 'Greenfoot.isKeyDown(String key)' to catch the response; using 'Greenfoot.getKey()' would be more appropriate in this case. One other thing (and I hope and pray that this is not what it looks like): the first line is not in a method, is it? (it should be a world variable -- and possibly static). Anyways, for getting the keystrokes:
how to make menu in the beginning of the game?
By snow13, with 2 replies.
Last reply by Builderboy2005, about 13 years ago:
Alternatively, it might be easier to create an entirely different world that you can switch into. This can make pausing a bit easier, since if you stayed in the same world, you would need methods in all the objects to support pausing.
range
By tylers, with 3 replies.
Last reply by danpost, about 13 years ago:
You will need to track two things within the for loop, that need to be initialized
before
the for loop. One to hold to closest gun object found, so far ('closestGun'), and one to hold the closest distance of that gun object ('closeness'). As you go through the for loop, compare the distance of the current gun class object with 'closeness' and if it is closer than replace the values of both variables. When the for loop is done, 'closestGun' will contain the correct gun class object. Calculate the angle between 'this' and the 'closestGun' and pass that to the projectile object class c
AI Work
By cobblerschris, with 9 replies.
Last reply by cobblerschris, about 13 years ago:
Hi i have emailed you.....
984
985
986
987
988
989
990
X