diff options
Diffstat (limited to 'src/components.cpp')
-rw-r--r-- | src/components.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/components.cpp b/src/components.cpp index b06bf84..2bd93fc 100644 --- a/src/components.cpp +++ b/src/components.cpp @@ -26,9 +26,12 @@ void MovementSystem::update(entityx::EntityManager &en, entityx::EventManager &e if (entity.has_component<Animate>() && entity.has_component<Sprite>()) { auto animate = entity.component<Animate>(); auto sprite = entity.component<Sprite>(); - - animate->updateAnimation(1, sprite->sprite, dt); - } + + if (direction.x) + animate->updateAnimation(1, sprite->sprite, dt); + else + animate->firstFrame(1, sprite->sprite); + } if (entity.has_component<Dialog>() && entity.component<Dialog>()->talking) { direction.x = 0; } else { |