]> code.bitgloo.com Git - clyne/gamedev.git/commitdiff
merge fixes
authorClyne Sullivan <tullivan99@gmail.com>
Sat, 22 Oct 2016 22:51:45 +0000 (18:51 -0400)
committerClyne Sullivan <tullivan99@gmail.com>
Sat, 22 Oct 2016 22:51:45 +0000 (18:51 -0400)
1  2 
src/player.cpp

diff --cc src/player.cpp
index fcbff1cda1792fcc6fdb4ec6f8cf81af55ab2c35,95a9c081f8b6aacc2581982add47dee71303cae0..82de470e7357d62275772e2697210320caadcf41
@@@ -62,7 -62,7 +62,8 @@@ void PlayerSystem::receive(const KeyUpE
  void PlayerSystem::receive(const KeyDownEvent &kde)
  {
        auto kc = kde.keycode;
 +      auto& loc = *game::entities.get(pid).component<Position>().get();
+     auto& faceLeft = game::entities.get(pid).component<Sprite>().get()->faceLeft;
  
        /*auto worldSwitch = [&](const WorldSwitchInfo& wsi){
                player->canMove = false;
                        }*/
                } else if (kc == getControl(1)) {
                        if (!ui::fadeEnable) {
-                 moveLeft = true;
+                 moveLeft = faceLeft = true;
                                moveRight = false;
  
 -                /*if (currentWorldToLeft) {
 -                                      std::thread([&](void){
 -                                              auto thing = currentWorld->goWorldLeft(p);
 -                                              if (thing.first != currentWorld)
 -                                                      worldSwitch(thing);
 -                                      }).detach();
 -                              }*/
 +                              game::engine.getSystem<WorldSystem>()->goWorldLeft(loc);
                        }
                } else if (kc == getControl(2)) {
                        if (!ui::fadeEnable) {
-                               moveLeft = false;
+                               moveLeft = faceLeft = false;
                  moveRight = true;
  
 -                /*if (currentWorldToRight) {
 -                                      std::thread([&](void){
 -                                              auto thing = currentWorld->goWorldRight(p);
 -                                              if (thing.first != currentWorld)
 -                                                      worldSwitch(thing);
 -                                      }).detach();
 -                              }*/
 -                      }
 +                              game::engine.getSystem<WorldSystem>()->goWorldRight(loc);
 +                      }
                } else if (kc == getControl(3)) {
                        if (game::canSprint)
                                speed = 2.0f;