From eab72cafb0ffb04d139beabd34be83a7e6480410 Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Sun, 13 Aug 2023 08:22:04 +0100 Subject: Use FIRE1 (jump) instead of space This allow full control with the joystick. --- src/game.c | 8 ++++++-- src/menu.c | 10 +++++----- 2 files changed, 11 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/game.c b/src/game.c index 0acd9d9..7d62a40 100644 --- a/src/game.c +++ b/src/game.c @@ -205,15 +205,19 @@ static uint8_t run_gameover() sound_music_pattern(PAT_GAMEOVER); + uint8_t ctl = CTL_NONE; + /* wait some time, and check if the player wants to continue */ for (uint16_t i = 0; i < 524; i++) { if (stage < STAGES_LEN) { if (i == 200 || i == 400) - put_text(68, 105, "PRESS SPACE TO CONTINUE", i == 200 ? 5 : 0); + put_text(72, 105, "PRESS JUMP TO CONTINUE", i == 200 ? 5 : 0); + + ctl = control_read(); - if (i > 200 && i < 400 && keys[KEY_SPACE]) + if (i > 200 && i < 400 && (ctl & CTL_FIRE1)) { sound_music_pattern(PAT_SILENCE); return 1; diff --git a/src/menu.c b/src/menu.c index 5a459e8..d2de630 100644 --- a/src/menu.c +++ b/src/menu.c @@ -26,7 +26,7 @@ static void render_menu() Rect dst = { 80, 45, 160, 38 }; blit(binary_title_start, &dst); - put_text(84, 110, "PRESS SPACE TO PLAY", 1); + put_text(88, 110, "PRESS JUMP TO PLAY", 1); put_text(64, 140, "CODE, GRAPHICS AND SOUND", 2); put_text(96, 150, "JUAN J. MARTINEZ", 3); @@ -88,9 +88,9 @@ uint8_t run_menu() if (keys[KEY_ESC]) return 0; - if (keys[KEY_SPACE] || (ctl & CTL_FIRE1)) + if (ctl & CTL_FIRE1) { - while (keys[KEY_SPACE] || (ctl & CTL_FIRE1)) + while (ctl & CTL_FIRE1) { ctl = control_read(); wait_vsync(); @@ -100,7 +100,7 @@ uint8_t run_menu() for (uint8_t i = 0; i < 32; i++) { - put_text(84, 110, "PRESS SPACE TO PLAY", i & 2 ? 5 : 0); + put_text(88, 110, "PRESS JUMP TO PLAY", i & 2 ? 5 : 0); wait_vsync(); } wait_frames(96); @@ -137,7 +137,7 @@ uint8_t run_menu() if (wait == 80) wait = 0; - put_text(84, 110, "PRESS SPACE TO PLAY", wait ? 0 : 1); + put_text(88, 110, "PRESS JUMP TO PLAY", wait ? 0 : 1); wait_vsync(); } } -- cgit v1.2.3