From 428c401f9c1053f7e13ffe641758dfb72791d8dc Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Fri, 26 Jun 2015 19:59:28 -0400 Subject: Player now moves --- src/components/animatable.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/components/animatable.h (limited to 'src/components/animatable.h') 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 @@ +#ifndef SPRITE_RENDERABLE_H_D3AACBBF +#define SPRITE_RENDERABLE_H_D3AACBBF + +#include "component.h" +#include "renderer.h" +#include "direction.h" + +class AnimatableComponent : public Component { + public: + AnimatableComponent(const char* filename, int frame_width, int frame_height, int frames_across); + + int getFrame() const; + void setFrame(int frame); + + const Texture& getTexture() const; + Rectangle getFrameRect() const; + + void setDirection(Direction dir) {}; + void setWalking(bool w) {}; + void setJumping(bool w) {}; + void setCrouching(bool w) {}; + + private: + Texture texture; + int frame_width; + int frame_height; + int frames_across; + int frame = 0; +}; + +#endif /* end of include guard: SPRITE_RENDERABLE_H_D3AACBBF */ -- cgit 1.4.1