diff options
| author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2015-06-26 19:59:28 -0400 |
|---|---|---|
| committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2015-06-26 19:59:28 -0400 |
| commit | 428c401f9c1053f7e13ffe641758dfb72791d8dc (patch) | |
| tree | 3b7c74e0346db3d08319e309c37e975e19395d74 /src/components/animatable.h | |
| parent | 55c8a14a7e2b2dadf0def3e09f970818164366f5 (diff) | |
| download | therapy-428c401f9c1053f7e13ffe641758dfb72791d8dc.tar.gz therapy-428c401f9c1053f7e13ffe641758dfb72791d8dc.tar.bz2 therapy-428c401f9c1053f7e13ffe641758dfb72791d8dc.zip | |
Player now moves
Diffstat (limited to 'src/components/animatable.h')
| -rw-r--r-- | src/components/animatable.h | 31 |
1 files changed, 31 insertions, 0 deletions
| diff --git a/src/components/animatable.h b/src/components/animatable.h new file mode 100644 index 0000000..cf6ee54 --- /dev/null +++ b/src/components/animatable.h | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | #ifndef SPRITE_RENDERABLE_H_D3AACBBF | ||
| 2 | #define SPRITE_RENDERABLE_H_D3AACBBF | ||
| 3 | |||
| 4 | #include "component.h" | ||
| 5 | #include "renderer.h" | ||
| 6 | #include "direction.h" | ||
| 7 | |||
| 8 | class AnimatableComponent : public Component { | ||
| 9 | public: | ||
| 10 | AnimatableComponent(const char* filename, int frame_width, int frame_height, int frames_across); | ||
| 11 | |||
| 12 | int getFrame() const; | ||
| 13 | void setFrame(int frame); | ||
| 14 | |||
| 15 | const Texture& getTexture() const; | ||
| 16 | Rectangle getFrameRect() const; | ||
| 17 | |||
| 18 | void setDirection(Direction dir) {}; | ||
| 19 | void setWalking(bool w) {}; | ||
| 20 | void setJumping(bool w) {}; | ||
| 21 | void setCrouching(bool w) {}; | ||
| 22 | |||
| 23 | private: | ||
| 24 | Texture texture; | ||
| 25 | int frame_width; | ||
| 26 | int frame_height; | ||
| 27 | int frames_across; | ||
| 28 | int frame = 0; | ||
| 29 | }; | ||
| 30 | |||
| 31 | #endif /* end of include guard: SPRITE_RENDERABLE_H_D3AACBBF */ | ||
