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
Creating a multi-agent system
By Hertel, with 1 reply.
Replied to by davmac, about 12 years ago:
I think you should read the tutorials, especially #6.
How do we create a memory game consisiting with arrays that generate a random number from 1-10?
By leeyong0, with 3 replies.
Last reply by davmac, about 12 years ago:
What part are you having trouble with?
Object count
By Gingervitis, with 16 replies.
Last reply by danpost, about 12 years ago:
Remove the following lines: 12, 15 through 19, 23 & 24, 26 through 28, 48 through 57, 70 and 105. Line 12: not needed because the variable defaults to zero; Line 15 through 19: does not do anything and looks out of place; Line 23 & 24: not needed because the variables default to zero; Lines 26 through 28: variable is not used anywhere in the class Lines 48 through 57:
belongs in the Moon world class code
Line 70: meaningless where placed (not used in method) Line 105: useless if changing worlds.
I need help (java programing)
By Jeremy.F, with 1 reply.
Replied to by danpost, about 12 years ago:
The
Java tutorials
is the best place to start. Begin with the second section on the left, named
Trails Covering the Basics
.
Changing images based off certain actions
By r4indr0ps, with 1 reply.
Replied to by danpost, about 12 years ago:
I am not sure what it really means, either. I am quite sure it would not even compile as written. The methods 'normalMan' and 'manOnFire' are both showing that they are to return a boolean type value, but no values are being returned at all. Change both occurances of 'boolean' to 'void' and it will compile. Then, you will need an 'act' method to check for collision; and when the collision occurs call one of the two methods. You should call the other method in the constructor block to initially set the image of the actor.
Need help with some code
By JHankins, with 2 replies.
Last reply by JHankins, about 12 years ago:
Thank you so much I appreciate the help. Going to try inserting these now and keep my fingers crossed I do it right.
Making Walls :)
By FuRiAx, with 7 replies.
Last reply by danpost, about 12 years ago:
Looks like you might run into either a nullPointerException in your 'fire' method (around line 122 of the Rocket class or an illegalStateException in the 'canSee' method of the Mover class when the rocket hits an asteroid. The rocket is removed from the world when it hits an asteroid, so any intersect checking (or use of 'getX' or 'getY') will fail and any 'getWorld' call will return null. To avoid these possible errors, change your 'act' method in the Rocket class to:
How to move random y value 50% of the time?
By bbwf, with 4 replies.
Last reply by actinium, about 12 years ago:
What's not obvious is that a method that returns an int looks like an overloaded method for getRandomNumber that returns a boolean. Never noticed getRandomNumber being used in that context.
Soccer Computer Movement
By sirjustinhe, with 11 replies.
Last reply by sirjustinhe, about 12 years ago:
ohhhhhh thanks.
Document containing code examples
By ianto0710, with 1 reply.
Replied to by davmac, about 12 years ago:
Click "Documentation" above and then see the links in the "Reference" section. You are perhaps thinking of the PDF version.
leaves-and-wombats
By krishnb001, with 1 reply.
Replied to by danpost, about 12 years ago:
If the wombat was placed in the top-left square initially, it would not be too difficult to program it to traverse across one row and drop to the next to traverse back across. However, there are two things that would highly complicate matters. To continue after it traverses the last row, something would need to be incorporated; and placing the wombat randomly at an even or odd row will produce different conditions. Some things that would need to be kept track of are (1) if the last move was a vertical move or not (2) whether the wombat is panning down or up the rows (3) whether we are in th
Adding randomDogs to DogWorld
By CHERNANDEZ95, with 6 replies.
Last reply by danpost, about 12 years ago:
The use of 'wait(3)' will cause the whole scenario to essentially pause for the duration of the waiting time, which I doubt seriously is what you want. What you need to do is add a counter to count the act cycle;, and every so many cycles, change the image; and after so many more cycles, change the image back and reset the counter.
turnAtLeftWall() Got a question! I know the answer is probably simple and I'm just not seeing it but I'm just starting and I'm lost. So here is my instructions and here is what I have so far. I can't figure out how to get the "orb" to bounce off the top a
By keiko1dog, with 13 replies.
Last reply by danpost, about 12 years ago:
The format of any method call in OOP (object-oriented progamming) is
object.action
. If there is no object supplied, then it is assumed to be the 'this' keyword, which refers to the object created from that class the method is in. For a sound, a GreenfootSound object is the object and 'play' is the action you wish to have it do. So, create a GreenfootSound object using the GreenfootSound constructor call and save it in a GreenfootSound field. Then when you want to 'make noise', name the sound and action to perform.
How to programm pascal's triangle??
By Mux, with 2 replies.
Last reply by Mux, about 12 years ago:
It's exactly what i was looking for. thx
Getting location of an actor from an actor
By student101, with 38 replies.
Last reply by danpost, about 12 years ago:
danpost wrote...
<Code Omitted>
I had supplied this yesterday. Line 10 was trying to tell you that the world saved in 'gameWorld' needs to be passed along from world to world until you finally return to it by using the code on line 13.
882
883
884
885
886
887
888
X