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
If Loop or While Loop? Or something different?
By gmacias, with 1 reply.
Replied to by danpost, about 10 years ago:
If you think about the execution of lines 74 through 77 and of lines 79 through 82, you will see that since the location of the ambulance does not change while the loops execute, the loop will never be exited. Therefore, you will continually create cloud objects (one overtop of another) until memory is used up. Using 'if' is sufficient in both places (lines 74 and 79 -- instead of 'while'). It would be best to have your cloud object have a short lifespan. For one thing, so you do not have too many actors which can cause lagging; and for another, so when the car gets back off the sand, they
code not working
By gamingskyrim, with 3 replies.
Last reply by Super_Hippo, about 10 years ago:
You have to import the List class. <Code Omitted>
Snake game- length of snake
By nush99, with 2 replies.
Last reply by nush99, about 10 years ago:
okay, thanks!
bounce off walls
By sjstiglet, with 1 reply.
Replied to by davmac, about 10 years ago:
sjstiglet wrote...
Nothing I try works.
If you post what you think is your best attempt, we can help you figure out what is wrong with it.
Multiplayer?
By kiarocks, with 13 replies.
Last reply by apps92, about 10 years ago:
Hi, I have run the scenario in latest version of greenfoot, it shows the compilation error, of three old methods setSimulation being obselete. I have replaced them with the new set method. However still when I run the scenario as a server, keeping ip address blank, it shows a runtime exception java.lang.RuntimeException: Error: Connection has not been initialised. at Connection.receiveInts(Connection.java:197) at Rocket.act(Rocket.java:92)
Objects get stuck at top and right of screen?
By JarJarBanks7, with 13 replies.
Last reply by danpost, about 10 years ago:
JarJarBanks7 wrote...
One problem though,using an else statement would only work if there were only two directions; if an else is used, then if it isnt 1 it would run the d==2 code .same goes for any other d= statement that you add an else to.If this isnt what you meant then explain further or if willing,give example code
You could just add an 'else' at the beginning of lines 56 and 62. That way each axis is treated separately.
the fruit doesnt glitch out and constantly try to move left and right a the same time, it just stops, sometimes before the edge
This was becaus
How to add game you made
By JovanLazic, with 1 reply.
Replied to by Super_Hippo, about 10 years ago:
You want to upload a scenario? In your Greenfoot program, click on Export in the top right corner.
Issue with counter (nullexceptionerror)
By ladamson, with 1 reply.
Replied to by Super_Hippo, about 10 years ago:
The issue is (probably) in your WombatWorld class. Please use the 'code' tags to post code.
java.lang.OutOfMemoryError: HOW CAN I SOLVE IT
By dimpap5555, with 5 replies.
Last reply by dimpap5555, about 10 years ago:
Thank you very much guys if i have new problems i will inform you again
gameover
By Dayuyu, with 5 replies.
Last reply by Dayuyu, about 10 years ago:
i done it thank for help
Final score
By Dayuyu, with 1 reply.
Replied to by danpost, about 10 years ago:
You could just have the final world add the Score object to itself with something like this: <Code Omitted>
pause button
By Dayuyu, with 2 replies.
Last reply by Dayuyu, about 10 years ago:
ok i have object overtop...now i fix that... it work.. thank..
Snake game- score counter
By nush99, with 1 reply.
Replied to by danpost, about 10 years ago:
Whether you want a visible counter or not, you can check out my
Value Display Tutorial
scenario.
Random timed movement, ranged player detection and camera tracking
By Parte, with 113 replies.
Last reply by Parte, about 10 years ago:
danpost wrote...
Parte wrote...
I have added a Movement_Test2 class because if the code for the movement (moving up,down,left,right) are in the same class as the Player class which contains the mouse movement; the player will merge with the walls when up against the walls as the player turns, to avoid this I split the movement of the player into a separate class.
There would be no difference had you placed the movement code in the act method of the class of the player. You can still be moving, or adjusting the location of the player, on similar conditions. That is, I realize that the im
Actor not in the world error
By ymym, with 2 replies.
Last reply by danpost, about 10 years ago:
You could also force an immediate exit from the act method by adding a return statement after removing the actor from the world: <Code Omitted>Any other actions you may want to do when the actor is removed can be done before the return statement (or even before removing the actor).
440
441
442
443
444
445
446
X