From b5e018343cd429b0823578964c53c486540c7812 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Wed, 23 Mar 2022 12:15:43 -0400 Subject: holding opposite directions doesn't cancel each other out anymore --- src/game.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/game.cpp') diff --git a/src/game.cpp b/src/game.cpp index 7c82a38..c965cd3 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -511,9 +511,7 @@ bool Game::processKeys(const Input& keystate) if (keystate.up) { py--; - } - - if (keystate.down) + } else if (keystate.down) { py++; dir = Direction::down; @@ -523,9 +521,7 @@ bool Game::processKeys(const Input& keystate) { px--; dir = Direction::left; - } - - if (keystate.right) + } else if (keystate.right) { px++; dir = Direction::right; -- cgit 1.4.1