summaryrefslogtreecommitdiff
path: root/src/game.c
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2022-12-10 13:32:47 -0800
committerVito Caputo <vcaputo@pengaru.com>2022-12-10 13:47:49 -0800
commitc81b7ce086951ab52ac2a507bbd544284610f4ab (patch)
tree2d5490ead3db1a3cb48d0819f8549c25819f5ceb /src/game.c
parent916af615ddef151f78c23d996caf01c18a57e9d8 (diff)
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.
Diffstat (limited to 'src/game.c')
-rw-r--r--src/game.c5
1 files 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) {
© All Rights Reserved