summary refs log tree commit diff stats
path: root/src/animation_system.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/animation_system.cpp')
-rw-r--r--src/animation_system.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/animation_system.cpp b/src/animation_system.cpp index 3320e1d..cf34066 100644 --- a/src/animation_system.cpp +++ b/src/animation_system.cpp
@@ -91,9 +91,11 @@ void AnimationSystem::tick(double dt) {
91 animTimer_.accumulate(dt); 91 animTimer_.accumulate(dt);
92 while (animTimer_.step()) { 92 while (animTimer_.step()) {
93 for (Sprite& sprite : game_.getSprites() | game_.spriteView()) { 93 for (Sprite& sprite : game_.getSprites() | game_.spriteView()) {
94 sprite.animationFrame++; 94 if (sprite.isAnimated) {
95 if (sprite.animationFrame >= sprite.animations[sprite.animationId].size()) { 95 sprite.animationFrame++;
96 sprite.animationFrame = 0; 96 if (sprite.animationFrame >= sprite.animations[sprite.animationId].size()) {
97 sprite.animationFrame = 0;
98 }
97 } 99 }
98 } 100 }
99 } 101 }