summaryrefslogtreecommitdiff
path: root/src/game.c
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2022-12-08 14:49:45 -0800
committerVito Caputo <vcaputo@pengaru.com>2022-12-08 14:49:45 -0800
commitef21bf2bccd6f5e0e70b8a74d68ffea537e7dd44 (patch)
treeff2130e2b5e4af9c85a2128b3ef39bd81d9d0e1b /src/game.c
parentdeeeb92628344011651548372e7e27dca780dfc3 (diff)
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.
Diffstat (limited to 'src/game.c')
-rw-r--r--src/game.c4
1 files 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;
}
© All Rights Reserved