From 8d7ef2b2ae3ddff204f5934fe67c535d7f1345e9 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Wed, 3 Feb 2021 02:03:59 -0500 Subject: Converted Party into CharacterSystem --- src/animation_system.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/animation_system.cpp') 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) { animTimer_.accumulate(dt); while (animTimer_.step()) { for (Sprite& sprite : game_.getSprites() | game_.spriteView()) { - sprite.animationFrame++; - if (sprite.animationFrame >= sprite.animations[sprite.animationId].size()) { - sprite.animationFrame = 0; + if (sprite.isAnimated) { + sprite.animationFrame++; + if (sprite.animationFrame >= sprite.animations[sprite.animationId].size()) { + sprite.animationFrame = 0; + } } } } -- cgit 1.4.1