From: clyne Date: Sun, 1 Sep 2019 16:58:59 +0000 (-0400) Subject: Oops, swap left and right player movement X-Git-Tag: v0.1-alpha^2 X-Git-Url: https://code.bitgloo.com/?a=commitdiff_plain;h=9e8de69a19edfdf52da54ded3d098cf6282ccdc9;p=clyne%2Fgamedev2.git Oops, swap left and right player movement --- diff --git a/src/player.cpp b/src/player.cpp index 22bd0ef..c72a4e4 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -53,10 +53,10 @@ void PlayerSystem::receive(const KeyDownEvent& kue) if (player.valid()) { if (kue.sym == SDLK_a) { if (auto vel = player.component(); vel) - vel->x += GROUND_VELOCITY; + vel->x -= GROUND_VELOCITY; } else if (kue.sym == SDLK_d) { if (auto vel = player.component(); vel) - vel->x -= GROUND_VELOCITY; + vel->x += GROUND_VELOCITY; } } } @@ -66,10 +66,10 @@ void PlayerSystem::receive(const KeyUpEvent& kue) if (player.valid()) { if (kue.sym == SDLK_a) { if (auto vel = player.component(); vel) - vel->x -= GROUND_VELOCITY; + vel->x += GROUND_VELOCITY; } else if (kue.sym == SDLK_d) { if (auto vel = player.component(); vel) - vel->x += GROUND_VELOCITY; + vel->x -= GROUND_VELOCITY; } } }