]> code.bitgloo.com Git - clyne/gamedev2.git/commitdiff
fix player keys...
authorClyne Sullivan <clyne@bitgloo.com>
Sun, 1 Sep 2019 21:24:01 +0000 (17:24 -0400)
committerClyne Sullivan <clyne@bitgloo.com>
Sun, 1 Sep 2019 21:24:01 +0000 (17:24 -0400)
src/player.cpp

index 7d1653ea8f0d039ed7958d9fce062c418706ed6c..187d61a588b431e66becf21bf15962330c5b3fd6 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;
         }
     }
 }