diff options
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 */ | ||