Removes "resume" option from menu when game over.

This commit is contained in:
Linus Probert 2018-07-09 22:53:52 +02:00
parent 988d6c5cac
commit 252955bc8d
1 changed files with 16 additions and 0 deletions

View File

@ -295,6 +295,21 @@ initInGameMenu(void)
createMenu(&inGameMenu, menu_items, 3); createMenu(&inGameMenu, menu_items, 3);
} }
static void
createInGameGameOverMenu(void)
{
struct MENU_ITEM menu_items[] = {
{ "MAIN MENU", goToMainMenu },
{ "QUIT", exitGame },
};
if (inGameMenu) {
menu_destroy(inGameMenu);
inGameMenu = NULL;
}
createMenu(&inGameMenu, menu_items, 2);
}
static void static void
initMainMenu(void) initMainMenu(void)
{ {
@ -553,6 +568,7 @@ run_game(void)
gui_event_message("You died!"); gui_event_message("You died!");
mixer_play_effect(SPLAT); mixer_play_effect(SPLAT);
gGameState = GAME_OVER; gGameState = GAME_OVER;
createInGameGameOverMenu();
} else { } else {
check_next_level(); check_next_level();
} }