diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2022-12-08 14:49:45 -0800 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2022-12-08 14:49:45 -0800 |
commit | ef21bf2bccd6f5e0e70b8a74d68ffea537e7dd44 (patch) | |
tree | ff2130e2b5e4af9c85a2128b3ef39bd81d9d0e1b /src/game.c | |
parent | deeeb92628344011651548372e7e27dca780dfc3 (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.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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; } |