From 77be863f4f15d2481a64e4e8dadb4060a6e4e590 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sun, 11 Feb 2018 12:34:52 -0500 Subject: Implemented map rendering and basic collision Only wall and platform collision currently works, and map edges are not currently implemented. --- src/components/ponderable.h | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'src/components/ponderable.h') diff --git a/src/components/ponderable.h b/src/components/ponderable.h index dfbf908..ac759b6 100644 --- a/src/components/ponderable.h +++ b/src/components/ponderable.h @@ -6,13 +6,27 @@ class PonderableComponent : public Component { public: - enum class state { + enum class Type { + vacuumed, + freefalling + }; + + enum class State { grounded, jumping, falling, dropping }; + PonderableComponent(Type type) : type_(type) + { + } + + inline Type getType() const + { + return type_; + } + inline double getVelocityX() const { return velX_; @@ -53,12 +67,12 @@ public: accelY_ = v; } - inline state getState() const + inline State getState() const { return state_; } - inline void setState(state arg) + inline void setState(State arg) { state_ = arg; } @@ -69,7 +83,8 @@ private: double velY_ = 0.0; double accelX_ = 0.0; double accelY_ = 0.0; - state state_ = state::grounded; + Type type_ = Type::vacuumed; + State state_ = State::grounded; }; #endif /* end of include guard: TANGIBLE_H_746DB3EE */ -- cgit 1.4.1