diff options
| author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-13 12:14:58 -0500 |
|---|---|---|
| committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-13 12:14:58 -0500 |
| commit | ed933607765a6e010689aaaf85184053ff6e8a2b (patch) | |
| tree | 9c59ddfa9c7ddb221788485ad96cad116f8b0c28 /src/sprite.h | |
| parent | e9602acecd1c5f63c6cf72a270a1bd09eba1e7e1 (diff) | |
| download | tanetane-ed933607765a6e010689aaaf85184053ff6e8a2b.tar.gz tanetane-ed933607765a6e010689aaaf85184053ff6e8a2b.tar.bz2 tanetane-ed933607765a6e010689aaaf85184053ff6e8a2b.zip | |
Added non-looping animations
Lucas can get electrocuted now.
Diffstat (limited to 'src/sprite.h')
| -rw-r--r-- | src/sprite.h | 8 |
1 files changed, 7 insertions, 1 deletions
| 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 { | |||
| 16 | vec2i size; | 16 | vec2i size; |
| 17 | }; | 17 | }; |
| 18 | 18 | ||
| 19 | struct Animation { | ||
| 20 | bool looping = true; | ||
| 21 | std::vector<int> frameIndices; | ||
| 22 | }; | ||
| 23 | |||
| 19 | enum class CharacterState { | 24 | enum class CharacterState { |
| 20 | Still, | 25 | Still, |
| 21 | Walking, | 26 | Walking, |
| @@ -48,8 +53,9 @@ public: | |||
| 48 | int animationId = 0; | 53 | int animationId = 0; |
| 49 | int animationFrame = 0; | 54 | int animationFrame = 0; |
| 50 | std::vector<SpriteFrame> frames; | 55 | std::vector<SpriteFrame> frames; |
| 51 | std::vector<std::vector<int>> animations; | 56 | std::vector<Animation> animations; |
| 52 | std::map<std::string, std::map<Direction, int>> nameDirToAnim; | 57 | std::map<std::string, std::map<Direction, int>> nameDirToAnim; |
| 58 | bool animFinished = false; | ||
| 53 | bool hasShadow = false; | 59 | bool hasShadow = false; |
| 54 | 60 | ||
| 55 | // Character | 61 | // Character |
