Adds "NEW GAME" menu option to game over menu
Also makes menu open when player dies
This commit is contained in:
parent
4612cabe00
commit
4819eda1dd
|
@ -299,6 +299,7 @@ static void
|
||||||
createInGameGameOverMenu(void)
|
createInGameGameOverMenu(void)
|
||||||
{
|
{
|
||||||
struct MENU_ITEM menu_items[] = {
|
struct MENU_ITEM menu_items[] = {
|
||||||
|
{ "NEW GAME", startGame },
|
||||||
{ "MAIN MENU", goToMainMenu },
|
{ "MAIN MENU", goToMainMenu },
|
||||||
{ "QUIT", exitGame },
|
{ "QUIT", exitGame },
|
||||||
};
|
};
|
||||||
|
@ -307,7 +308,7 @@ createInGameGameOverMenu(void)
|
||||||
menu_destroy(inGameMenu);
|
menu_destroy(inGameMenu);
|
||||||
inGameMenu = NULL;
|
inGameMenu = NULL;
|
||||||
}
|
}
|
||||||
createMenu(&inGameMenu, menu_items, 2);
|
createMenu(&inGameMenu, menu_items, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -582,6 +583,7 @@ run_game(void)
|
||||||
mixer_play_effect(SPLAT);
|
mixer_play_effect(SPLAT);
|
||||||
gGameState = GAME_OVER;
|
gGameState = GAME_OVER;
|
||||||
createInGameGameOverMenu();
|
createInGameGameOverMenu();
|
||||||
|
toggleInGameMenu(NULL);
|
||||||
} else {
|
} else {
|
||||||
check_next_level();
|
check_next_level();
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
#include "mixer.h"
|
#include "mixer.h"
|
||||||
#include "collisions.h"
|
#include "collisions.h"
|
||||||
|
|
||||||
typedef struct MenuItems_t {
|
typedef struct MenuItems {
|
||||||
Sprite *sprite;
|
Sprite *sprite;
|
||||||
Sprite *hsprite;
|
Sprite *hsprite;
|
||||||
GuiButton *button;
|
GuiButton *button;
|
||||||
|
|
Loading…
Reference in New Issue