EXIT to menu (including after last level)
This commit is contained in:
parent
81f316eae6
commit
07301f1b8d
36
src/main.c
36
src/main.c
|
@ -80,17 +80,8 @@ int strcount(char const *str, int c)
|
|||
return count;
|
||||
}
|
||||
|
||||
int main(void)
|
||||
void game_loop(int current_episode, int current_level)
|
||||
{
|
||||
__printf_enable_fp();
|
||||
|
||||
/* Azur trickz for less tearing */
|
||||
r61524_set(0x010, 0x0010);
|
||||
|
||||
int current_episode = 0;
|
||||
int current_level = 0;
|
||||
main_menu(¤t_episode, ¤t_level);
|
||||
|
||||
game_t game;
|
||||
memset(&game, 0x00, sizeof game);
|
||||
|
||||
|
@ -164,9 +155,13 @@ int main(void)
|
|||
bool rotate_left=false, rotate_right=false;
|
||||
|
||||
key_event_t e;
|
||||
bool stop_playing=false;
|
||||
|
||||
while ((e = pollevent()).type != KEYEV_NONE) {
|
||||
if (e.type == KEYEV_DOWN && e.key == KEY_MENU)
|
||||
gint_osmenu();
|
||||
if (e.type == KEYEV_DOWN && e.key == KEY_EXIT)
|
||||
stop_playing = true;
|
||||
}
|
||||
if (keydown(KEY_7)) {
|
||||
rotate_left = true;
|
||||
|
@ -174,6 +169,8 @@ int main(void)
|
|||
if (keydown(KEY_0)) {
|
||||
rotate_right = true;
|
||||
}
|
||||
if (stop_playing)
|
||||
break;
|
||||
|
||||
/* Level transitions */
|
||||
|
||||
|
@ -286,5 +283,22 @@ int main(void)
|
|||
}
|
||||
|
||||
timer_stop(timer);
|
||||
return (1);
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
__printf_enable_fp();
|
||||
|
||||
/* Azur trickz for less tearing */
|
||||
r61524_set(0x010, 0x0010);
|
||||
|
||||
int current_episode = 0;
|
||||
int current_level = 0;
|
||||
|
||||
while(1) {
|
||||
main_menu(¤t_episode, ¤t_level);
|
||||
game_loop(current_episode, current_level);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue