From cefe66cdbb8786dc455657376e36f0ff8785d5bc Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Thu, 8 Feb 2018 12:34:42 -0500 Subject: Introduced animated sprites Also restyled a lot of the code. --- src/components/ponderable.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/components/ponderable.h') diff --git a/src/components/ponderable.h b/src/components/ponderable.h index 80100d7..dfbf908 100644 --- a/src/components/ponderable.h +++ b/src/components/ponderable.h @@ -6,6 +6,13 @@ class PonderableComponent : public Component { public: + enum class state { + grounded, + jumping, + falling, + dropping + }; + inline double getVelocityX() const { return velX_; @@ -51,12 +58,18 @@ public: return state_; } + inline void setState(state arg) + { + state_ = arg; + } + private: double velX_ = 0.0; double velY_ = 0.0; double accelX_ = 0.0; double accelY_ = 0.0; + state state_ = state::grounded; }; #endif /* end of include guard: TANGIBLE_H_746DB3EE */ -- cgit 1.4.1