This site requires JavaScript, please enable it in your browser!
Greenfoot back
K_wow
K_wow wrote ...

2013/7/31

How to instantly start a scenario?

K_wow K_wow

2013/7/31

#
I am experimenting with getting a greenfoot scenario to start as soon as it is launched. In the world constructor, I use the method "Greenfoot.start();". It does work, and the actors act, but greenfoot won't detect any keyboard input. Does anyone know how to fix this?
MatheMagician MatheMagician

2013/7/31

#
Click on the screen first, and then the keyboard will start working.
K_wow K_wow

2013/7/31

#
MatheMagician wrote...
Click on the screen first, and then the keyboard will start working.
It isn't working. Once I restart the scenario, greenfoot won't accept keyboard input, even after I have clicked on the screen (I take it you mean the world?). The only way I can get it working again is to pause and run again.
K_wow K_wow

2013/7/31

#
MatheMagician wrote...
Click on the screen first, and then the keyboard will start working.
Actually, I've found its really unreliable. Sometimes Greenfoot will accept keyboard input almost straight away, and other times you need to wait up to 5 seconds before you can use the keyboard. However, if you use the keyboard before Greenfoot starts accepting keyboard input, you won't be able to use the keyboard at all, until you pause or reset.
You need to login to post a reply.