diff options
author | clyne <clyne@bitgloo.com> | 2019-09-01 12:58:59 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-01 12:58:59 -0400 |
commit | 9e8de69a19edfdf52da54ded3d098cf6282ccdc9 (patch) | |
tree | 099ed060d60b6530d86d67ba1bda3008b8d58ba2 | |
parent | e7fee98e0ee15665b40b383baf925356bb81f20d (diff) |
Oops, swap left and right player movement
-rw-r--r-- | src/player.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
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<Velocity>(); vel) - vel->x += GROUND_VELOCITY; + vel->x -= GROUND_VELOCITY; } else if (kue.sym == SDLK_d) { if (auto vel = player.component<Velocity>(); 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<Velocity>(); vel) - vel->x -= GROUND_VELOCITY; + vel->x += GROUND_VELOCITY; } else if (kue.sym == SDLK_d) { if (auto vel = player.component<Velocity>(); vel) - vel->x += GROUND_VELOCITY; + vel->x -= GROUND_VELOCITY; } } } |