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
How to make a dart shoot out of my dart gun
By arinb, with 6 replies.
Last reply by danpost, over 11 years ago:
Put a check in the Dart class, first determine its distance from where the mouse was clicked and set its location there if within one move of the location. If not that close, do the normal move (use an 'if-else').
SWIMMING HELP - Urgent
By SWAG, with 5 replies.
Last reply by Gevater_Tod4711, over 11 years ago:
For a smooth movement you just need to use double values instead of int values for the location of the players. If you have a look at the class Player in
Operation: Crash Test
you'll find what you need. Just use the class Player as the superclass and it should work.
Movement
By FCG, with 1 reply.
Replied to by bourne, over 11 years ago:
You could have something like this: <Code Omitted>
Rounding
By JetLennit, with 2 replies.
Last reply by JetLennit, over 11 years ago:
Thank you! Worked great!
up and down help
By FCG, with 9 replies.
Last reply by danpost, over 11 years ago:
You should be creating objects for the world in the world constructor or a 'prepare' method that it calls. You would use something like 'new Platform(100, 300)' to create a Platform object that will move vertically between the two values given.
URGENT
By Gzuzfrk, with no replies.
Can someone send my a simple code that's like this but will the object will go back to the stand image when ever key is let go. <Code Omitted>
java.lang.NullPointerException
By Miikku, with 12 replies.
Last reply by Miikku, over 11 years ago:
Thank you it works! You are BEST!
EXPLODING
By Avik, with 10 replies.
Last reply by Avik, over 11 years ago:
sorry im quite new, what does that mean?
Key Control
By Gzuzfrk, with no replies.
How do I make it to where the code works? It only will switch images if I press left but the images wont switch if I press right <Code Omitted>
How to solve it: java.lang.IllegalStateException: Actor not in world.
By Miikku, with 3 replies.
Last reply by Miikku, over 11 years ago:
It works! :) Thanks for help!
Exploding
By Avik, with 4 replies.
Last reply by GreenGoo, over 11 years ago:
Look at my scenario and just copy the explosion code : http://www.greenfoot.org/scenarios/8371
Scrolling Text Box
By SP00F3R, with 2 replies.
Last reply by danpost, over 11 years ago:
A simple class for a scolling textbox might look like the following:
help whit shooting
By gust.ramos, with 1 reply.
Replied to by danpost, over 11 years ago:
The problem with the code is what I have made bold: if("c".equals(
Greenfoot.getKey()
)){ newBomb(); }else if ("x".equals(
Greenfoot.getKey()
)){ newBullet(); } You are calling 'getKey' twice within the same act cycle. The second call will always return 'null'. So, what you need to do is save what is returned the first time in a local field and use its value for comparing. <Code Omitted>
Urgent
By Avik, with 3 replies.
Last reply by Gevater_Tod4711, over 11 years ago:
Then you should set the location of the coins to the other edge of the world: <Code Omitted>
What Was Your First Game?
By JetLennit, with 7 replies.
Last reply by GreenGoo, over 11 years ago:
My first game, without using Mik's tutorials, was a very simple game where some turrets shot at a car which the player controlled.
833
834
835
836
837
838
839
X