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

2014/4/17

Starting world after pressing enter

collint25 collint25

2014/4/17

#
I have a title screen that pops up over the world whenever you run the game. Whenever you press enter the title screen disappears and the game is supposed to start. The only problem is that whenever I click run on the program, the world starts running instantly in the background. How do I get it to where you run the program, the title screen pops up but it doesn't start the world until you press enter?
Entity1037 Entity1037

2014/4/17

#
Create an instance of the world only when the enter key is pressed.
collint25 collint25

2014/4/17

#
Entity1037 wrote...
Create an instance of the world only when the enter key is pressed.
Can you give me an example of how I would go about doing that please?
danpost danpost

2014/4/18

#
Use a separate world for your title screen and have its act method detect the press of the "enter" key. When detected, create and set active a new game world instance.
You need to login to post a reply.