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
Looking for a way to pause one method while another finishes
By bjonesre, with 6 replies.
Last reply by bjonesre, over 13 years ago:
I see what you mean, if the Asteroid is class is being removed it would make sense why I was getting a null pointer. Hopefully I'll get a chance to get it working tonight. Thanks.
how to spawn random worms after they have been eaten
By kingenzo, with 2 replies.
Last reply by kingenzo, over 13 years ago:
thanks
Set a new world from a class in Actor
By Solringolt, with 2 replies.
Last reply by Solringolt, over 13 years ago:
Thx a lot it works with this!
Creating a multi-agent system
By Hertel, with 1 reply.
Replied to by davmac, over 13 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, over 13 years ago:
What part are you having trouble with?
Object count
By Gingervitis, with 16 replies.
Last reply by danpost, over 13 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, over 13 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, over 13 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, over 13 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, over 13 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, over 13 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, over 13 years ago:
ohhhhhh thanks.
Document containing code examples
By ianto0710, with 1 reply.
Replied to by davmac, over 13 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, over 13 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, over 13 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.
885
886
887
888
889
890
891
X