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
A simple question! Please answer.
By myheartwillgoon, with 1 reply.
Replied to by Gevater_Tod4711, about 13 years ago:
Set speed doesn't set the speed of only one class but of whole Greenfoot. so if you say Greenfoot.setSpeed(35); and then Greenfoot.setSpeed(15); Greenfoot will only use the second of this values. Also in the botom right of greenfoot there is a scrollbar to set Greenfoots speed.
problems to write the right code for a scenario
By Insomnia, with 4 replies.
Last reply by Insomnia, about 13 years ago:
Do you want to write the code for me? :D I am not able to do this :(
What do we mean by regular array?
By hkrhässleholm, with 9 replies.
Last reply by hkrhässleholm, about 13 years ago:
Thanks, i think i got My expected answer
The nullPointerException error...
By Stormtrooper299, with 10 replies.
Last reply by davmac, about 13 years ago:
<Code Omitted>
But does that still have the same problem?
Yes, because if Enemies.main is null the call to Enemies.main.getWorld() causes a NullPointerException. However, you can simply change the order: <Code Omitted> In this version, due to "lazy evaluation", if Enemies.main is null then Enemies.main.getWorld() will not be evaluated.
Avoid start screen
By Malmotri, with 4 replies.
Last reply by Malmotri, about 13 years ago:
Some other thing is wrong wrong now. This shows up java.lang.ArrayIndexOutOfBoundsException: 3 at Snake.act(Snake.java:34) at greenfoot.core.Simulation.actActor(Simulation.java:565) at greenfoot.core.Simulation.runOneLoop(Simulation.java:523) at greenfoot.core.Simulation.runContent(Simulation.java:213) at greenfoot.core.Simulation.run(Simulation.java:203) I uploaded this scenario so you you can see whats wrong. I would be very grateful. http://www.greenfoot.org/scenarios/6773 This is how i did it.
How can I create red brick square on greenfoot?
By Future, with 1 reply.
Replied to by danpost, about 13 years ago:
We could say that the code to get a square/rectangle is built into the GreenfootImage of the Actor. Each actor has an 'image' which IS a rectangular area. Within the bounds of this rectangle is where the image of the actor appears. You only need to create a GreenfootImage object of appropriate size and draw along each edge the image of the brick (just program it to draw one edge, then rotate the main image to continue drawing the brick image around all four edges).
help
By BradH, with 2 replies.
Last reply by BradH, about 13 years ago:
ahhh, thanks just a simple error.
cannot find symbol - method getColor()
By JES201027, with 4 replies.
Last reply by JES201027, about 13 years ago:
Never mind I got it, thanks though!
Make object1 push object 2 to a certain location and go back to its starting location
By Luffy, with 6 replies.
Last reply by Luffy, about 13 years ago:
Thanks
java alternative to string.copy?
By erdelf, with 10 replies.
Last reply by davmac, about 13 years ago:
Well apparently, the C++ copy method returns:
The effective length of the sequence of characters copied to s. This may either be equal to parameter n or to size()-pos, whichever is smaller (see description of parameter n).
which also makes me notice that the code I gave above doesn't account for when the specified substring would be longer than the string itself. But you can check that for yourself, adjust the second parameter of substr appropriately, and calculate the amount "copied" by subtracting the first parameter value from the second (or even just taking the length of the
Stopping when a score is reached.
By Penguins_and_Orbs, with 7 replies.
Last reply by Penguins_and_Orbs, about 13 years ago:
Is the middle bit all supposed to go into the world class?
Hey Friends~ getOneObjectAtOffset HELP T.T
By leeyong0, with 2 replies.
Last reply by leeyong0, about 13 years ago:
I wuv yu~ nohomo but iwuvyu~
Textfield
By Sl3nDeRm4n, with 7 replies.
Last reply by Sl3nDeRm4n, about 13 years ago:
thank you
Can't get the totalscore
By Malmotri, with 2 replies.
Last reply by Malmotri, about 13 years ago:
Thank you very much!
HI
By myheartwillgoon, with 4 replies.
Last reply by danpost, about 13 years ago:
Being 'getOneObjectAtOffset' returns one object (if any) whose image intersects the point in question, your actor could end up partially overlapping the food and not detect it. Better would be to use the 'getOneIntersectingObject' method (unless, of course, you want to make it much more difficult to 'eat' the food -- cutting the 'hit-zone' in half). At any rate, when food is being placed, you should use the 'getOneIntersectingObject' method; otherwise it may be very difficult (or impossible) for the actor to find the food without hitting the obstacle.
917
918
919
920
921
922
923
X