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

2013/10/17

Title Screen Help

quicklearner quicklearner

2013/10/17

#
I know This question has been asked a lot, but I cant seem to find a answer people like me will understand, please tell me If I'm wrong but I have checked all the posts I could find.But anyway I want to add a title screen, say you have to press enter on a run button on the screen and the game will start, something like that. Or just a picture, then when you press greenfoots "run" button it switches to the game. Please try and keep it understandable for somewhat of a novice.Thanks
davmac davmac

2013/10/17

#
You just have two world classes - one for the title screen and one for the main game. Use Greenfoot.setWorld(...) to transition from one to the other. For example:
Greenfoot.setWorld(new GameWorld());
If you put that in the act() method of your title-screen world, it will switch as soon as you press Greenfoot's run button.
You need to login to post a reply.