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

2014/7/26

Start Menu for game?

ddemarco06 ddemarco06

2014/7/26

#
I am trying to implement a start menu in my game and I created a image of the screen with the instructions as well as a Press "enter" to begin. In the act method for my Startmenu class I have a checkKeys method that checks if enter is pressed and removes the object if it is. In my world class I have the startmenu being placed into the world. My problem is, once I click run the entire scenario runs where all my actors methods are called so basically the game is running in the background, and after I press enter and the Startmenu disappears your character could already be dead. I've been experimenting with the Greenfoot.start() and delay methods but haven't had luck figuring the right way to use them in this instance. Any help or advice would be appreciated. Thank you!
danpost danpost

2014/7/26

#
Place all your game construction after the line that removes the Startmenu object. As an alternative, you can create another World subclass for the menu (separating that code from the game code) and start a new game world when 'enter' is pressed. Avoid using 'delay' until you are familiar with how it behaves when used. 'Greenfoot.start()' is buggy and required you (at least for now) to add the following statement after it:
WorldVisitor.startSequence(this);
ddemarco06 ddemarco06

2014/7/26

#
That worked perfectly, thank you, sir!
You need to login to post a reply.