diff options
| author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-01-30 14:43:41 -0500 |
|---|---|---|
| committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-01-30 14:43:41 -0500 |
| commit | 8a38699f399103d4ee003e6eb63dd62656115be2 (patch) | |
| tree | 765a62bacc24d8a4c57ea56915de6731294c824b /src/sprite.h | |
| parent | 2c91a60b5fd79aa2c978ce4496a068f15a4df5cc (diff) | |
| download | tanetane-8a38699f399103d4ee003e6eb63dd62656115be2.tar.gz tanetane-8a38699f399103d4ee003e6eb63dd62656115be2.tar.bz2 tanetane-8a38699f399103d4ee003e6eb63dd62656115be2.zip | |
Sprite animations are more generic than still/walk now
Diffstat (limited to 'src/sprite.h')
| -rw-r--r-- | src/sprite.h | 7 |
1 files changed, 3 insertions, 4 deletions
| diff --git a/src/sprite.h b/src/sprite.h index 5e8003b..82ea90c 100644 --- a/src/sprite.h +++ b/src/sprite.h | |||
| @@ -31,7 +31,7 @@ public: | |||
| 31 | 31 | ||
| 32 | Direction getDirection() const { return curDir_; } | 32 | Direction getDirection() const { return curDir_; } |
| 33 | 33 | ||
| 34 | void setWalking(bool walking); | 34 | void setState(std::string state); |
| 35 | 35 | ||
| 36 | void tickAnim(); | 36 | void tickAnim(); |
| 37 | 37 | ||
| @@ -43,12 +43,11 @@ private: | |||
| 43 | vec2i loc_ { 0, 0 }; | 43 | vec2i loc_ { 0, 0 }; |
| 44 | vec2i size_; | 44 | vec2i size_; |
| 45 | Direction curDir_ = Direction::down; | 45 | Direction curDir_ = Direction::down; |
| 46 | bool isWalking_ = false; | 46 | std::string state_; |
| 47 | int curAnim_ = 0; | 47 | int curAnim_ = 0; |
| 48 | int curFrame_ = 0; | 48 | int curFrame_ = 0; |
| 49 | std::vector<std::vector<int>> animations_; | 49 | std::vector<std::vector<int>> animations_; |
| 50 | std::map<Direction, int> stillAnims_; | 50 | std::map<std::string, std::map<Direction, int>> stateDirToAnim_; |
| 51 | std::map<Direction, int> walkingAnims_; | ||
| 52 | }; | 51 | }; |
| 53 | 52 | ||
| 54 | #endif /* end of include guard: SPRITE_H_70503825 */ | 53 | #endif /* end of include guard: SPRITE_H_70503825 */ |
