From c81b7ce086951ab52ac2a507bbd544284610f4ab Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Sat, 10 Dec 2022 13:32:47 -0800 Subject: game: shorten game over (loss) delay The delay primarily serves to prevent accidental keypresses from the gameplay at death bleeding into the high score wait state, which would immediately leave the high score. But a full second delay on the losing game over is kind of long, esp. when you're agitated and just want to immediately restart. The delay is also overloaded a bit in the winning game over state, as it governs the TP explosion duration which occurs within this debouncing-like delay. So this commit diverges the two and leaves the winning delay at 1s, while turning the losing delay to .5s. --- src/game.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/game.c b/src/game.c index 1c05ed8..b11c4b4 100644 --- a/src/game.c +++ b/src/game.c @@ -71,7 +71,8 @@ #define GAME_KBD_DELAY_MS 20 #define GAME_KBD_TIMER PLAY_TICKS_TIMER4 -#define GAME_OVER_DELAY_MS 1000 +#define GAME_OVER_DELAY_MS 500 +#define GAME_OVER_WIN_DELAY_MS 1000 /* longer for TP explosion animation */ #define GAME_OVER_TIMER PLAY_TICKS_TIMER2 #define GAME_FLASHERS_DELAY_MS 75 @@ -1194,7 +1195,7 @@ static void game_update(play_t *play, void *context) break; case GAME_STATE_OVER_WINNING_DELAY: { - float t = (float)(play_ticks(play, GAME_OVER_TIMER) * 1.f / (float)GAME_OVER_DELAY_MS); + float t = (float)(play_ticks(play, GAME_OVER_TIMER) * 1.f / (float)GAME_OVER_WIN_DELAY_MS); teepee_icon_t *tp = game->teepee_head; if (t > 1.f) { -- cgit v1.2.3