]> code.bitgloo.com Git - clyne/gamedev2.git/commitdiff
Oops, swap left and right player movement
authorclyne <clyne@bitgloo.com>
Sun, 1 Sep 2019 16:58:59 +0000 (12:58 -0400)
committerGitHub <noreply@github.com>
Sun, 1 Sep 2019 16:58:59 +0000 (12:58 -0400)
src/player.cpp

index 22bd0ef08c870b9477ccae1ac6dff21c893f6d17..c72a4e4473d438bffca887498cde3862351ee547 100644 (file)
@@ -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;
                }
        }
 }