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
Player1 can shoot, but Player2 can't
By DaveFenste, with 6 replies.
Last reply by DaveFenste, over 10 years ago:
It works, thanks very much! :)
Problem with German Umlauts
By hector, with 3 replies.
Last reply by erdelf, over 10 years ago:
the getKey method returns the last key pressed since the last method call, so in a while loop might not return something regularily
Dynamically creating objects one at a time
By xk1u, with 1 reply.
Replied to by FlyingRabidUnicornPig, over 10 years ago:
You can make a "timer" that counts how many pixels the boat has moved since the last checkpoint. If it is a set point, you can do something like this: <Code Omitted> If you are making at different points (for example, one location is farther than the next), you can either make an array of all the checkpoints (by X location),
If statements with multiple actors
By Ushi1, with 3 replies.
Last reply by danpost, over 10 years ago:
Presuming that you always have one RobbersRetreat in the world: <Code Omitted>
How to check if all instances of a class have been removed
By Euan, with 2 replies.
Last reply by Euan, over 10 years ago:
Thanks a million, I added it and it worked a charm, thanks for the quick and helpful reply
Howto minimap?
By Robto, with 2 replies.
Last reply by chrl98, over 10 years ago:
Hi, Robto, can you show me the scenario that has a minimap incorporated to it. Thanks, since I want to make one in my game too. (Sorry for activating an old discussion)
Rotating from a point?
By Doge, with 3 replies.
Last reply by danpost, over 10 years ago:
<Code Omitted>Adding the above to your actor subclass will save the center of rotation for the actor you added into the world. In your 'act' method <Code Omitted>The radial distance ('10' in the example) will be the distance between t
Moving Objects
By helium11, with 2 replies.
Last reply by bourne, over 10 years ago:
To get a reference of the baby you could try using the button's (Actor's) getWorld() method and then calling the World's getObjects(java.lang.Class cls) which returns a List of all Actors in the World of type cls, which you can call get(int index) on (assuming there is always a baby in the World)
How to define a range of coordinates?
By DSP512, with 3 replies.
Last reply by bourne, over 10 years ago:
Call the randomSpawn method in the World's constructor a number of times (instead of in the act method which is executed continuously as the scenario runs) You can use a for loop to create a block of code that is ran a number of times: for (int i = 0; i < 5; i++) // This will run the following block 5 times { }
Read a String
By bernhard, with 2 replies.
Last reply by bernhard, over 10 years ago:
Okay that's a pitty. I guess I'll just leave that out. Thank you anyway
removing objects
By craigv, with 9 replies.
Last reply by DSP512, over 10 years ago:
thank you
Couple more errors
By Ushi1, with 15 replies.
Last reply by danpost, over 10 years ago:
You probably need an instance int field for the speed; adjusting its value depending on what key(s) are down and then using the final value to move with.
cannot find symbol - method
By NullPointer, with 1 reply.
Replied to by danpost, over 10 years ago:
If it is saying that it cannot find the 'getFigur' method from a class other than 'Spiel', then you are probably not letting the system know to look in the 'Spiel' class for that method. From an Actor subclass (with an actor that is in the world), you would use the 'getWorld' method and typecast the returned world to a Spiel world object: <Code Omitted>Without the typecasting, the system does not know to look in any subclass of the World class (which is the type of object that 'getWorld' returns).
Centring and Scrollimg
By Ushi1, with 1 reply.
Replied to by Gevater_Tod4711, over 10 years ago:
You can use my
Infinite Scrolling World
. The scrolling system makes the actor stay in the middle of the world and move the whole world arround him.
All scenarios on the site with scrollbars...
By erdelf, with 8 replies.
Last reply by davmac, over 10 years ago:
Try a different web browser. It sounds like the one you're using is doing something funky.
736
737
738
739
740
741
742
X