summary refs log tree commit diff stats
path: root/src/sprite.h
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2021-01-30 09:41:31 -0500
committerKelly Rauchenberger <fefferburbia@gmail.com>2021-01-30 09:41:31 -0500
commit410f971972bde37fb852420ea2ca0e2f69f27256 (patch)
tree73262614d4688e4f9a26c97557db5720b049029e /src/sprite.h
parent78e5bd2e622204d0deab252d9b2ab90c3095b67d (diff)
downloadtanetane-410f971972bde37fb852420ea2ca0e2f69f27256.tar.gz
tanetane-410f971972bde37fb852420ea2ca0e2f69f27256.tar.bz2
tanetane-410f971972bde37fb852420ea2ca0e2f69f27256.zip
Encapsulated some player movement stuff
Imported vector from therapy5
Diffstat (limited to 'src/sprite.h')
-rw-r--r--src/sprite.h19
1 files changed, 7 insertions, 12 deletions
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 @@
3 3
4#include <string_view> 4#include <string_view>
5#include "renderer.h" 5#include "renderer.h"
6#include "vector.h"
6 7
7class Sprite { 8class Sprite {
8public: 9public:
@@ -13,25 +14,19 @@ public:
13 return textureId_; 14 return textureId_;
14 } 15 }
15 16
16 int getX() { return x_; } 17 const vec2i& loc() const { return loc_; }
17 18
18 void setX(int x) { x_ = x; } 19 vec2i& loc() { return loc_; }
19 20
20 void setY(int y) { y_ = y; } 21 const vec2i& size() const { return size_; }
21 22
22 int getY() { return y_; } 23 vec2i& size() { return size_; }
23
24 int getWidth() { return width_; }
25
26 int getHeight() { return height_; }
27 24
28private: 25private:
29 26
30 int textureId_; 27 int textureId_;
31 int x_ = 0; 28 vec2i loc_ { 0, 0 };
32 int y_ = 0; 29 vec2i size_ { 17*4, 27 * 4 };
33 int width_ = 17*4;
34 int height_ = 27*4;
35}; 30};
36 31
37#endif /* end of include guard: SPRITE_H_70503825 */ 32#endif /* end of include guard: SPRITE_H_70503825 */