diff options
| author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2018-02-08 12:34:42 -0500 |
|---|---|---|
| committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2018-02-08 12:34:42 -0500 |
| commit | cefe66cdbb8786dc455657376e36f0ff8785d5bc (patch) | |
| tree | 7e90536fad90f2954b3834dc4959f402883c32b3 /src/components/ponderable.h | |
| parent | cec0ed92c4035c4421d3cc2448f5423fcbb7f7d4 (diff) | |
| download | therapy-cefe66cdbb8786dc455657376e36f0ff8785d5bc.tar.gz therapy-cefe66cdbb8786dc455657376e36f0ff8785d5bc.tar.bz2 therapy-cefe66cdbb8786dc455657376e36f0ff8785d5bc.zip | |
Introduced animated sprites
Also restyled a lot of the code.
Diffstat (limited to 'src/components/ponderable.h')
| -rw-r--r-- | src/components/ponderable.h | 13 |
1 files changed, 13 insertions, 0 deletions
| 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 @@ | |||
| 6 | class PonderableComponent : public Component { | 6 | class PonderableComponent : public Component { |
| 7 | public: | 7 | public: |
| 8 | 8 | ||
| 9 | enum class state { | ||
| 10 | grounded, | ||
| 11 | jumping, | ||
| 12 | falling, | ||
| 13 | dropping | ||
| 14 | }; | ||
| 15 | |||
| 9 | inline double getVelocityX() const | 16 | inline double getVelocityX() const |
| 10 | { | 17 | { |
| 11 | return velX_; | 18 | return velX_; |
| @@ -51,12 +58,18 @@ public: | |||
| 51 | return state_; | 58 | return state_; |
| 52 | } | 59 | } |
| 53 | 60 | ||
| 61 | inline void setState(state arg) | ||
| 62 | { | ||
| 63 | state_ = arg; | ||
| 64 | } | ||
| 65 | |||
| 54 | private: | 66 | private: |
| 55 | 67 | ||
| 56 | double velX_ = 0.0; | 68 | double velX_ = 0.0; |
| 57 | double velY_ = 0.0; | 69 | double velY_ = 0.0; |
| 58 | double accelX_ = 0.0; | 70 | double accelX_ = 0.0; |
| 59 | double accelY_ = 0.0; | 71 | double accelY_ = 0.0; |
| 72 | state state_ = state::grounded; | ||
| 60 | }; | 73 | }; |
| 61 | 74 | ||
| 62 | #endif /* end of include guard: TANGIBLE_H_746DB3EE */ | 75 | #endif /* end of include guard: TANGIBLE_H_746DB3EE */ |
