From 4819eda1ddd08428b4276c4466bb6a4def8ffdfc Mon Sep 17 00:00:00 2001 From: Linus Probert Date: Tue, 31 Jul 2018 23:08:34 +0200 Subject: [PATCH] Adds "NEW GAME" menu option to game over menu Also makes menu open when player dies --- src/main.c | 4 +++- src/menu.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index 7569d7c..c167a14 100644 --- a/src/main.c +++ b/src/main.c @@ -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(); } diff --git a/src/menu.c b/src/menu.c index 9c9520c..e0cac1a 100644 --- a/src/menu.c +++ b/src/menu.c @@ -27,7 +27,7 @@ #include "mixer.h" #include "collisions.h" -typedef struct MenuItems_t { +typedef struct MenuItems { Sprite *sprite; Sprite *hsprite; GuiButton *button;