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
Tick Speed in Greenfoot
By Agent40, with 1 reply.
Replied to by danpost, almost 8 years ago:
You can change the speed of the scenario by moving the handle on the speed slider to the right of the Run button or you can set it programmatically (usually in the world constructor) using: <Code Omitted>
Problem dabei etwas an einem zufälligem Ort spawnen zu lassen aber auf bestimmten koordinaten nicht
By Iiuz, with 28 replies.
Last reply by Iiuz, almost 8 years ago:
import greenfoot. *; public class Healkit extends Actor { long lastAdded = System.currentTimeMillis (); int randomX; int randomY; public Healkit() { randomX = Greenfoot.getRandomNumber (18) +1; randomY = Greenfoot.getRandomNumber (14) +1; } protected void addedToWorld(World world) { if (getOneIntersectingObject(Baum.class) != null ) getWorld().removeObject(this); } public void act() { long curTime = System.currentTimeMillis(); if (curTime == lastAdded + 20
When an object has hit an edge 8 times, have the object disappear
By Miguel.Valdez, with 20 replies.
Last reply by Vercility, almost 8 years ago:
"I Googled it" is always a legitimate answer, assuming you Actually understood it and didn't just copy paste :P Aside from that, that's how I do it as well, for said reason but also because you can never know if there might be a mistake if you don't understand yourself
Trying to sync object with music
By Brantgarron, with 8 replies.
Last reply by danpost, almost 8 years ago:
An act counter would be like this: <Code Omitted>The timer is incremented every act cycle and is dependent on the act cycles which varies time-wise from machine to machine. The '40' suggests something like 3 beats in about every 2 seconds. The '200' would be the number of beats in the entire song. Using the syst
He can touch, when he has score > 5.
By Findr, with 5 replies.
Last reply by Yehuda, almost 8 years ago:
I wasn't sure which one to do, so I went according to the title and figured if there is a problem it will be mentioned, I didn't want to assume this information wasn't known.
Delay the entry of the first balls
By R0mane, with 8 replies.
Last reply by Vercility, almost 8 years ago:
danpost wrote...
Vercility wrote...
Is that greenfoot specific? Because Im pretty sure int values are null by default, the compiler will also throw this when trying to use an uninitialized value (A fresh array of ints will also contain null everywhere, doesnt it.) << Code blocks omitted >>
The codes you gave are showing local variables being declared. That is not the same as the aforementioned instance field declared at line 27. Also, an array, regardless of the type of elements it will hold, is an object and an array field is an Object reference and therefore is null when declared and
Still problems with my timer
By Kolyma, with 3 replies.
Last reply by Vercility, almost 8 years ago:
danpost wrote...
Vercility wrote...
If you want it to last 15 s use something like this << Code Omitted >>
Using
while
will halt the entire program as the timer runs. That behavior is rarely wanted. Also,
while
cannot be capitalized. @Kolyma, if you want your timer to run longer than 15 act cycles (probably about one-quarter of a second), you need to increase its initial value. Something like 900 act cycles would run for about 15 seconds. Change
%15
to
%60
in line 24 and change
timer
to
(timer/60)
in lines 17 and 26.
Hmm does it
Strange navigation of tank
By Timmy_11, with 5 replies.
Last reply by Timmy_11, almost 8 years ago:
Thank you so much!!!! My tank now navigates reliably.
Show score at the end of the game
By R0mane, with 5 replies.
Last reply by R0mane, almost 8 years ago:
Thanks a lot
Problem to create a timer
By Kolyma, with 5 replies.
Last reply by danpost, almost 8 years ago:
The only thing I asked you to do in the Level2 class was remove 3 lines (24, 26 and 39 in your first code posting of the class). The addTime method needs to be in the Timer class (with appropriate code).
I have an actor that moves on X-Axis while.....
By Timmy_11, with 7 replies.
Last reply by Yehuda, almost 8 years ago:
In
Math
class.
como aparecer actores en un determinado tiempo
By dani8a, with no replies.
hola tengo un problema estoy haciendo un proyecto escolar en la cual tengo que realizar el juego ENDURO de Atari pero no se como hacer que los autos enemigos aparezcan en un determinado tiempo ya logre hacer la parte en la que cuando los dejo atrás de mi me incremente puntos pero el problemas es que esos son los iniciales y se supone que mientras voy avanzando deben salir mas autos en un cierto tiempo
project doesn't start on page
By petyritonel, with 6 replies.
Last reply by petyritonel, almost 8 years ago:
thank you :)
Making an object appear and disappear after certain time
By Plasmic, with 1 reply.
Replied to by danpost, almost 8 years ago:
Save its image in a field and set its image to
null
to make it disappear. Set the image back to the saved image to make it reappear.
Need help with program?
By compex, with 3 replies.
Last reply by danpost, almost 8 years ago:
compex wrote...
Actually they all spread out across the world I just need help getting the red objects to form the half circle
What is the
for
loop supposed to accomplish?
275
276
277
278
279
280
281
X