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

2015/8/11

Start Screen

Camyh15 Camyh15

2015/8/11

#
Hello, how do you make a start screen where you have to press a specific button to make it go? Also, how do you make it so that you can choose your level when you press start (easy, medium or hard)? Do you need another actor or a new world for this action? Thanks!
danpost danpost

2015/8/11

#
You can use multiple techniques in creating a start screen. 1) use a separate world or the same 2) use an actor or the background of the world 3) the start screen can be shown until the 'Run' button is clicked on or until a key or the mouse is pressed while the scenario is running As far as the menu, it can be another set of actors or a different world; however, using a different world would keep the codes of both separate from each other and, therefore, easier to produce.
Camyh15 Camyh15

2015/8/11

#
danpost wrote...
You can use multiple techniques in creating a start screen. 1) use a separate world or the same 2) use an actor or the background of the world 3) the start screen can be shown until the 'Run' button is clicked on or until a key or the mouse is pressed while the scenario is running As far as the menu, it can be another set of actors or a different world; however, using a different world would keep the codes of both separate from each other and, therefore, easier to produce.
So you recommend doing number one? And you recommend making another world? Also, how would I get the start button to interact with the mouse click?
danpost danpost

2015/8/11

#
Camyh15 wrote...
how would I get the start button to interact with the mouse click?
The Greenfoot class has some methods that can be used to detect mouse actions. Keep a reference to the button in your world class and in its act method check for clicks on it.
Camyh15 Camyh15

2015/8/12

#
And how do I do that? (I know, I am a newbie).
danpost danpost

2015/8/12

#
I have multiple scenarios that uses buttons to actually display the codes of classes within that scenario. Most, if not all, show the code for the subclass of World that shows the buttons being created, referenced in fields, and checked for clicks in the act method. You do not even have to download the scenario to check it out (though for some you may need to be logged in and/or play the game out to get to the screen with the buttons). Just run the scenario here on the site. Most of them are tagged 'source-text'.
You need to login to post a reply.