From 2c91a60b5fd79aa2c978ce4496a068f15a4df5cc Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sat, 30 Jan 2021 13:13:32 -0500 Subject: Pressing two opposite directions at once now prioritises one instead of doing both --- src/party.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/party.cpp b/src/party.cpp index 19b9557..371514b 100644 --- a/src/party.cpp +++ b/src/party.cpp @@ -32,9 +32,7 @@ void Party::move(Game& game, const Input& keystate) { { pLoc.y() -= MOVEMENT_SPEED; dir = Direction::up; - } - - if (keystate.down) + } else if (keystate.down) { pLoc.y() += MOVEMENT_SPEED; dir = Direction::down; @@ -51,9 +49,7 @@ void Party::move(Game& game, const Input& keystate) { } else { dir = Direction::left; } - } - - if (keystate.right) + } else if (keystate.right) { pLoc.x() += MOVEMENT_SPEED; -- cgit 1.4.1