From cefe66cdbb8786dc455657376e36f0ff8785d5bc Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Thu, 8 Feb 2018 12:34:42 -0500 Subject: Introduced animated sprites Also restyled a lot of the code. --- src/components/animatable.cpp | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 src/components/animatable.cpp (limited to 'src/components/animatable.cpp') diff --git a/src/components/animatable.cpp b/src/components/animatable.cpp deleted file mode 100644 index fcd277c..0000000 --- a/src/components/animatable.cpp +++ /dev/null @@ -1,27 +0,0 @@ -#include "animatable.h" - -AnimatableComponent::AnimatableComponent(const char* filename, int frame_width, int frame_height, int frames_across) - : texture(filename), frame_width(frame_width), frame_height(frame_height), frames_across(frames_across) -{ - -} - -int AnimatableComponent::getFrame() const -{ - return frame; -} - -void AnimatableComponent::setFrame(int frame) -{ - this->frame = frame; -} - -const Texture& AnimatableComponent::getTexture() const -{ - return texture; -} - -Rectangle AnimatableComponent::getFrameRect() const -{ - return {frame_width * (frame % frames_across), frame_height * (frame / frames_across), frame_width, frame_height}; -} -- cgit 1.4.1