mirror of https://git.sr.ht/~kikoodx/momento
return to menu with MENU
This commit is contained in:
parent
a11b9d1c52
commit
88b1ac790a
|
@ -9,7 +9,7 @@ input_init(void)
|
|||
{
|
||||
struct Input input = {
|
||||
.keycodes = {KEY_LEFT, KEY_RIGHT, KEY_UP, KEY_DOWN, KEY_SHIFT,
|
||||
KEY_MENU},
|
||||
KEY_EXIT},
|
||||
};
|
||||
int i = KEYS_COUNT;
|
||||
while (i-- > 0)
|
||||
|
|
10
src/main.c
10
src/main.c
|
@ -90,7 +90,7 @@ main(void)
|
|||
player = player_init();
|
||||
|
||||
/* main game loop */
|
||||
while (!keydown(KEY_EXIT)) {
|
||||
while (1) {
|
||||
/* skip render frames */
|
||||
i = 1 + frameskip;
|
||||
while (i-- > 0) {
|
||||
|
@ -243,6 +243,14 @@ main(void)
|
|||
break;
|
||||
}
|
||||
dupdate();
|
||||
|
||||
/* return to main menu */
|
||||
/* TODO don't hardcode this */
|
||||
if (keydown(KEY_MENU)) {
|
||||
gint_osmenu();
|
||||
if (game_state == Playing)
|
||||
game_state = GamePause;
|
||||
}
|
||||
}
|
||||
|
||||
timer_stop(timer);
|
||||
|
|
Loading…
Reference in New Issue