diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-01-30 09:41:31 -0500 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-01-30 09:41:31 -0500 |
commit | 410f971972bde37fb852420ea2ca0e2f69f27256 (patch) | |
tree | 73262614d4688e4f9a26c97557db5720b049029e /src/sprite.h | |
parent | 78e5bd2e622204d0deab252d9b2ab90c3095b67d (diff) | |
download | tanetane-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.h | 19 |
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 | ||
7 | class Sprite { | 8 | class Sprite { |
8 | public: | 9 | public: |
@@ -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 | ||
28 | private: | 25 | private: |
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 */ |