summary refs log tree commit diff stats
path: root/src/game.cpp
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2022-03-19 16:52:18 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2022-03-19 16:52:18 -0400
commit669879f081a95335622f362b300e2e869e1046b3 (patch)
tree1c98941619ced8c882a38ab06e632ffa44bd72f7 /src/game.cpp
parentd6fc05a03f8ad49935d091351e30d46e51ff6694 (diff)
downloadether-669879f081a95335622f362b300e2e869e1046b3.tar.gz
ether-669879f081a95335622f362b300e2e869e1046b3.tar.bz2
ether-669879f081a95335622f362b300e2e869e1046b3.zip
added wasd movement
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp8
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()) {