From 669879f081a95335622f362b300e2e869e1046b3 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sat, 19 Mar 2022 16:52:18 -0400 Subject: added wasd movement --- src/game.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/game.cpp b/src/game.cpp index 501722d..72bcbfa 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -794,10 +794,10 @@ void Game::updatePlaying(size_t frameTime) { } const Uint8* state = SDL_GetKeyboardState(NULL); - keystate.left = state[SDL_SCANCODE_LEFT]; - keystate.right = state[SDL_SCANCODE_RIGHT]; - keystate.up = state[SDL_SCANCODE_UP]; - keystate.down = state[SDL_SCANCODE_DOWN]; + keystate.left = state[SDL_SCANCODE_LEFT] || state[SDL_SCANCODE_A]; + keystate.right = state[SDL_SCANCODE_RIGHT] || state[SDL_SCANCODE_D]; + keystate.up = state[SDL_SCANCODE_UP] || state[SDL_SCANCODE_W]; + keystate.down = state[SDL_SCANCODE_DOWN] || state[SDL_SCANCODE_S]; bumpCooldown.accumulate(frameTime); if (alreadyBumped && keystate != lastInput && bumpCooldown.step()) { -- cgit 1.4.1