Game Development Reference
In-Depth Information
The first expression in the method draws a new window on the screen. Then each of the next three expressions
handles a menu option via the set_handler method (located in Window_Selectable ). set_handler accepts two
parameters. The first parameter is the handle and the second parameter is the method . For example, the first set_handler
expression in create_command_window calls the command_new_game method when the :new_game handle is invoked.
This will become relevant in the next section. For now, the result, as you've almost certainly seen countless times
during play-testing, is the Title menu that has three options. So, we know that we want to draw the Title menu into
the Game Over screen. The next question becomes: How is this method drawing the window to the screen? If we
compare the start methods of Scene_Title and Scene_Gameover , we see that the game over method doesn't draw a
command window ( create_command_window ). You'll want to copy lines 88 through 128 of Scene_Title to your altered
Scene_Gameover method in the Materials section. Then, add create_command_window to Scene_Gameover 's start
method. It should look like the following:
def start
super
play_gameover_music
fadeout_frozen_graphics
create_background
create_command_window
end
With that out of the way, you're done! Now, play-test your game and get into a situation that causes a game over.
(It might be quicker to create an event that calls up the Game Over screen when you interact with it.) If you have
followed these instructions, your Game Over screen should look like Figure 14-3 .
Figure 14-3. A screenshot of the Game Over screen, menu now included
If you just wanted to have the Title screen menu in your game over, you are done.
Tweaking the Game Over Menu
However, what if you wanted to tweak the menu? As mentioned before, the menu window and options are handled
in create_command_window . You may be thinking that removing an option from this method is all you would have to
do. That is actually not true. If you do that, you'll still see the option in the game over menu. When you try to press the
 
Search WWH ::




Custom Search