diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2022-12-08 21:17:45 -0800 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2022-12-10 13:47:39 -0800 |
commit | 6cdb24ee9446cb0f19e7de8ac6d7db31a889b657 (patch) | |
tree | b675d003c1dbb7ebd3348128a8e7572e77d4074d /src/game.c | |
parent | ef21bf2bccd6f5e0e70b8a74d68ffea537e7dd44 (diff) |
game: leave game over waits on WASD and arrow keys too
I'd added SPACE and RETURN, but as those aren't used anywhere
else in sars it's unintuitive to require those spuriously, and
there's a good chance someone will reach for ESC first which will
quit the game instead of restarting.
Diffstat (limited to 'src/game.c')
-rw-r--r-- | src/game.c | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -1274,8 +1274,18 @@ static void game_dispatch(play_t *play, void *context, SDL_Event *event) if (event->key.keysym.sym == SDLK_ESCAPE) exit(0); - 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)) { + if ((game->state == GAME_STATE_OVER_WAITING || + game->state == GAME_STATE_OVER_WINNING_WAITING) && + (event->key.keysym.sym == SDLK_SPACE || + event->key.keysym.sym == SDLK_RETURN || + event->key.keysym.sym == SDLK_w || + event->key.keysym.sym == SDLK_a || + event->key.keysym.sym == SDLK_s || + event->key.keysym.sym == SDLK_d || + event->key.keysym.sym == SDLK_RIGHT || + event->key.keysym.sym == SDLK_LEFT || + event->key.keysym.sym == SDLK_DOWN || + event->key.keysym.sym == SDLK_UP)) { reset_game(play, game); break; } |