diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2022-03-19 16:52:18 -0400 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2022-03-19 16:52:18 -0400 |
commit | 669879f081a95335622f362b300e2e869e1046b3 (patch) | |
tree | 1c98941619ced8c882a38ab06e632ffa44bd72f7 /src | |
parent | d6fc05a03f8ad49935d091351e30d46e51ff6694 (diff) | |
download | ether-669879f081a95335622f362b300e2e869e1046b3.tar.gz ether-669879f081a95335622f362b300e2e869e1046b3.tar.bz2 ether-669879f081a95335622f362b300e2e869e1046b3.zip |
added wasd movement
Diffstat (limited to 'src')
-rw-r--r-- | src/game.cpp | 8 |
1 files 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) { | |||
794 | } | 794 | } |
795 | 795 | ||
796 | const Uint8* state = SDL_GetKeyboardState(NULL); | 796 | const Uint8* state = SDL_GetKeyboardState(NULL); |
797 | keystate.left = state[SDL_SCANCODE_LEFT]; | 797 | keystate.left = state[SDL_SCANCODE_LEFT] || state[SDL_SCANCODE_A]; |
798 | keystate.right = state[SDL_SCANCODE_RIGHT]; | 798 | keystate.right = state[SDL_SCANCODE_RIGHT] || state[SDL_SCANCODE_D]; |
799 | keystate.up = state[SDL_SCANCODE_UP]; | 799 | keystate.up = state[SDL_SCANCODE_UP] || state[SDL_SCANCODE_W]; |
800 | keystate.down = state[SDL_SCANCODE_DOWN]; | 800 | keystate.down = state[SDL_SCANCODE_DOWN] || state[SDL_SCANCODE_S]; |
801 | 801 | ||
802 | bumpCooldown.accumulate(frameTime); | 802 | bumpCooldown.accumulate(frameTime); |
803 | if (alreadyBumped && keystate != lastInput && bumpCooldown.step()) { | 803 | if (alreadyBumped && keystate != lastInput && bumpCooldown.step()) { |