From ef21bf2bccd6f5e0e70b8a74d68ffea537e7dd44 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Thu, 8 Dec 2022 14:49:45 -0800 Subject: game: space or enter keys to leave game over wait states Until now _any_ keydown would leave the wait state and reset the game, making it challenging to do things like create screenshots of your score+playfield. With this commit only enter or space will leave these wait states and reset the game. Escape still immediately quits from every state. --- src/game.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/game.c b/src/game.c index 0f14465..fa5d33d 100644 --- a/src/game.c +++ b/src/game.c @@ -1274,8 +1274,8 @@ static void game_dispatch(play_t *play, void *context, SDL_Event *event) if (event->key.keysym.sym == SDLK_ESCAPE) exit(0); - if (game->state == GAME_STATE_OVER_WAITING || - game->state == GAME_STATE_OVER_WINNING_WAITING) { + if ((event->key.keysym.sym == SDLK_SPACE || event->key.keysym.sym == SDLK_RETURN) && + (game->state == GAME_STATE_OVER_WAITING || game->state == GAME_STATE_OVER_WINNING_WAITING)) { reset_game(play, game); break; } -- cgit v1.2.3