From ed933607765a6e010689aaaf85184053ff6e8a2b Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sat, 13 Feb 2021 12:14:58 -0500 Subject: Added non-looping animations Lucas can get electrocuted now. --- src/sprite.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/sprite.h') diff --git a/src/sprite.h b/src/sprite.h index 84a7b03..fcf7e1d 100644 --- a/src/sprite.h +++ b/src/sprite.h @@ -16,6 +16,11 @@ struct SpriteFrame { vec2i size; }; +struct Animation { + bool looping = true; + std::vector frameIndices; +}; + enum class CharacterState { Still, Walking, @@ -48,8 +53,9 @@ public: int animationId = 0; int animationFrame = 0; std::vector frames; - std::vector> animations; + std::vector animations; std::map> nameDirToAnim; + bool animFinished = false; bool hasShadow = false; // Character -- cgit 1.4.1