From 410f971972bde37fb852420ea2ca0e2f69f27256 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sat, 30 Jan 2021 09:41:31 -0500 Subject: Encapsulated some player movement stuff Imported vector from therapy5 --- src/sprite.h | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'src/sprite.h') diff --git a/src/sprite.h b/src/sprite.h index d868bdb..c45e208 100644 --- a/src/sprite.h +++ b/src/sprite.h @@ -3,6 +3,7 @@ #include #include "renderer.h" +#include "vector.h" class Sprite { public: @@ -13,25 +14,19 @@ public: return textureId_; } - int getX() { return x_; } + const vec2i& loc() const { return loc_; } - void setX(int x) { x_ = x; } + vec2i& loc() { return loc_; } - void setY(int y) { y_ = y; } + const vec2i& size() const { return size_; } - int getY() { return y_; } - - int getWidth() { return width_; } - - int getHeight() { return height_; } + vec2i& size() { return size_; } private: int textureId_; - int x_ = 0; - int y_ = 0; - int width_ = 17*4; - int height_ = 27*4; + vec2i loc_ { 0, 0 }; + vec2i size_ { 17*4, 27 * 4 }; }; #endif /* end of include guard: SPRITE_H_70503825 */ -- cgit 1.4.1