(menu) Display time that was at the end of the last screen (Lephénixnoir suggestion)

This commit is contained in:
KikooDX 2020-03-25 13:48:11 +01:00
parent 2ea8054b93
commit 1f6f919b93
4 changed files with 8 additions and 3 deletions

BIN
JTMM.g3a

Binary file not shown.

View File

@ -1,2 +1,3 @@
char menu(int *level_id, char *disable_up_key, char *game_loop);
char menu(int *level_id, char *disable_up_key, char *game_loop,
unsigned int step);
char menu_level_selection(int *level_id);

View File

@ -50,6 +50,7 @@ int main(void)
int start_y = 9*16 + 4;
char spawn_buffer = 0;
unsigned int step = 0;
unsigned int rem_step = 0;
char pswap_held = 0;
char polarity = 0; //0 -> blue, 1 -> red
char enable_up_key = 0;
@ -214,6 +215,7 @@ int main(void)
if (collide(player_x, player_y, level, 'E'))
{
level_id++;
rem_step = step;
if (level_id == 5060)
{
just_breathe(step);
@ -234,7 +236,7 @@ int main(void)
{
if (!exit_buffer)
{
char reload = menu(&level_id, &enable_up_key, &game_loop);
char reload = menu(&level_id, &enable_up_key, &game_loop, rem_step);
if (reload)
{
if (level_id == 5050)

View File

@ -6,7 +6,8 @@
#define Y_POS 88
char menu(int *level_id, char *enable_up_key, char *game_loop)
char menu(int *level_id, char *enable_up_key, char *game_loop,
unsigned int rem_step)
{
char reload = 0;
char selected = 0;
@ -22,6 +23,7 @@ char menu(int *level_id, char *enable_up_key, char *game_loop)
if (selected == 4) selected = 0;
else if (selected == -1) selected = 3;
dclear(0);
dprint(0, 0, C_WHITE, C_BLACK, "%u.%02u", rem_step/60, rem_step%60);
dtext(32, Y_POS, "CONTINUE", C_WHITE, C_BLACK);
dtext(32, Y_POS + 12, "SELECT LEVEL", C_WHITE, C_BLACK);
dtext(32, Y_POS + 24, "UP KEY TO JUMP:", C_WHITE, C_BLACK);