Adds "NEW GAME" menu option to game over menu

Also makes menu open when player dies
This commit is contained in:
Linus Probert 2018-07-31 23:08:34 +02:00
parent 4612cabe00
commit 4819eda1dd
2 changed files with 4 additions and 2 deletions

View File

@ -299,6 +299,7 @@ static void
createInGameGameOverMenu(void)
{
struct MENU_ITEM menu_items[] = {
{ "NEW GAME", startGame },
{ "MAIN MENU", goToMainMenu },
{ "QUIT", exitGame },
};
@ -307,7 +308,7 @@ createInGameGameOverMenu(void)
menu_destroy(inGameMenu);
inGameMenu = NULL;
}
createMenu(&inGameMenu, menu_items, 2);
createMenu(&inGameMenu, menu_items, 3);
}
static void
@ -582,6 +583,7 @@ run_game(void)
mixer_play_effect(SPLAT);
gGameState = GAME_OVER;
createInGameGameOverMenu();
toggleInGameMenu(NULL);
} else {
check_next_level();
}

View File

@ -27,7 +27,7 @@
#include "mixer.h"
#include "collisions.h"
typedef struct MenuItems_t {
typedef struct MenuItems {
Sprite *sprite;
Sprite *hsprite;
GuiButton *button;