diff options
author | Andy <drumsetmonkey@gmail.com> | 2017-01-19 09:27:20 -0500 |
---|---|---|
committer | Andy <drumsetmonkey@gmail.com> | 2017-01-19 09:27:20 -0500 |
commit | 36ed75a7749b81fab69f66b9ef8bbf0d18489f73 (patch) | |
tree | f843825ac3fee04f20d264eece473c79c823d4a1 /src | |
parent | 213d9ccfbb4752d4c62d6b7e6b3f9172cdf1bccc (diff) |
When entities stop, their legs stop
Diffstat (limited to 'src')
-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 { |