From 8a38699f399103d4ee003e6eb63dd62656115be2 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sat, 30 Jan 2021 14:43:41 -0500 Subject: Sprite animations are more generic than still/walk now --- src/sprite.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/sprite.h') 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: Direction getDirection() const { return curDir_; } - void setWalking(bool walking); + void setState(std::string state); void tickAnim(); @@ -43,12 +43,11 @@ private: vec2i loc_ { 0, 0 }; vec2i size_; Direction curDir_ = Direction::down; - bool isWalking_ = false; + std::string state_; int curAnim_ = 0; int curFrame_ = 0; std::vector> animations_; - std::map stillAnims_; - std::map walkingAnims_; + std::map> stateDirToAnim_; }; #endif /* end of include guard: SPRITE_H_70503825 */ -- cgit 1.4.1