summary refs log tree commit diff stats
path: root/src/animation_system.cpp
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2021-02-03 02:03:59 -0500
committerKelly Rauchenberger <fefferburbia@gmail.com>2021-02-03 02:03:59 -0500
commit8d7ef2b2ae3ddff204f5934fe67c535d7f1345e9 (patch)
tree7bcc12dd2efab7e24867895c5ef3fbb3e7d0e36d /src/animation_system.cpp
parentbe09120d1d044b476ef8b516efbdb526f20d9e2d (diff)
downloadtanetane-8d7ef2b2ae3ddff204f5934fe67c535d7f1345e9.tar.gz
tanetane-8d7ef2b2ae3ddff204f5934fe67c535d7f1345e9.tar.bz2
tanetane-8d7ef2b2ae3ddff204f5934fe67c535d7f1345e9.zip
Converted Party into CharacterSystem
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 }