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
Wombats and Leaves Fighting for a Leaf
By frogfrog, with 1 reply.
Replied to by danpost, almost 7 years ago:
Probably depends on the order you placed the wombats into the world.
Wombats and Leafs Limit Question
By SilentHunter115, with 1 reply.
Replied to by danpost, almost 7 years ago:
You could add the following as the first line in the foundLeaf method, to prevent "seeing" the leaf when count is 2: <Code Omitted>
Question
By tuffguy5, with 1 reply.
Replied to by danpost, almost 7 years ago:
You would probably need to use the
getNeighbours
method, determine if the list returned was empty or not and, if not, (randomly?) remove (eat) one that is in the list.
Wombats facing each other
By lucky555, with 1 reply.
Replied to by danpost, almost 7 years ago:
You could vertically mirror the image of the one on the right: <Code Omitted>However, this will probably redden the image and the mirroring would need done every time the wombat faces the opposite direction. Better would be to have two
GreenfootImage
fields in the class to hold a right-facing and a left-facing wombat. On any turn to 0 or 180 degrees, set the appropriate image.
Moving The Wombat
By Baseball19, with 1 reply.
Replied to by danpost, almost 7 years ago:
Make line 40: <Code Omitted>
Change background in leaves and wombats
By Ravens52, with 1 reply.
Replied to by danpost, almost 7 years ago:
Remove line 18.
Disappearing Wombats
By Bicpen6, with 1 reply.
Replied to by danpost, almost 7 years ago:
Bicpen6 wrote...
In the Wombat and Leaves game, why do some of the wombats disappear after going around in a circle?
They are probably on top of each other (one hidden behind another).
Speed Of Rocket
By FlyersFan53, with 1 reply.
Replied to by danpost, almost 7 years ago:
You could make it any value you want; but it would help to make it a reasonable one. An initial value of zero is always a fair option.
Updating Instances of Classes
By Targetplaz, with 1 reply.
Replied to by danpost, almost 7 years ago:
Many ways. It would depend on how many wombats you want to be eaters (at one time); whether (and when) their eating status could change (among other things.
Actor Acceleration Question
By Kakorat859, with 1 reply.
Replied to by danpost, almost 7 years ago:
Just add the condition along with the thrust key being down that the speed is less than whatever max value you are setting. For example: <Code Omitted>
Leaves and Wombats (Wombats Lagging)
By JVaro573, with 1 reply.
Replied to by danpost, almost 7 years ago:
I guess you could make the leaf image somewhat transparent. That way, when two are together, it resultant image will appear darker than the rest.
Void Act Wombat
By Thor_21, with 1 reply.
Replied to by danpost, almost 7 years ago:
What happens when the wombat gets to the edge of the world (which way does it turn)? which way does it then move? what about when it reaches the next edge?
Wombats & Leaves circling
By 20summer, with 1 reply.
Replied to by danpost, almost 7 years ago:
Just how the code currently works. Change it if you want.
Turning Wombat
By Spiderman01, with 1 reply.
Replied to by danpost, almost 7 years ago:
Gotta' leave something for you to build your programming skills on.
Help with Wombat Movement
By Kanye4Prez, with 1 reply.
Replied to by danpost, almost 7 years ago:
Increase the value of the argument in the
move
command.
214
215
216
217
218
219
220
X