diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2015-06-26 19:59:28 -0400 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2015-06-26 19:59:28 -0400 |
commit | 428c401f9c1053f7e13ffe641758dfb72791d8dc (patch) | |
tree | 3b7c74e0346db3d08319e309c37e975e19395d74 /src/components/controllable.h | |
parent | 55c8a14a7e2b2dadf0def3e09f970818164366f5 (diff) | |
download | therapy-428c401f9c1053f7e13ffe641758dfb72791d8dc.tar.gz therapy-428c401f9c1053f7e13ffe641758dfb72791d8dc.tar.bz2 therapy-428c401f9c1053f7e13ffe641758dfb72791d8dc.zip |
Player now moves
Diffstat (limited to 'src/components/controllable.h')
-rw-r--r-- | src/components/controllable.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/components/controllable.h b/src/components/controllable.h new file mode 100644 index 0000000..317d68d --- /dev/null +++ b/src/components/controllable.h | |||
@@ -0,0 +1,36 @@ | |||
1 | #ifndef CONTROLLABLE_H_4E0B85B4 | ||
2 | #define CONTROLLABLE_H_4E0B85B4 | ||
3 | |||
4 | #include "component.h" | ||
5 | #include "renderer.h" | ||
6 | |||
7 | class ControllableComponent : public Component { | ||
8 | public: | ||
9 | int getLeftKey() const; | ||
10 | void setLeftKey(int k); | ||
11 | int getRightKey() const; | ||
12 | void setRightKey(int k); | ||
13 | int getJumpKey() const; | ||
14 | void setJumpKey(int k); | ||
15 | int getDropKey() const; | ||
16 | void setDropKey(int k); | ||
17 | |||
18 | bool isFrozen() const; | ||
19 | void setFrozen(bool f); | ||
20 | bool isHoldingLeft() const; | ||
21 | void setHoldingLeft(bool f); | ||
22 | bool isHoldingRight() const; | ||
23 | void setHoldingRight(bool f); | ||
24 | |||
25 | private: | ||
26 | int leftKey = GLFW_KEY_LEFT; | ||
27 | int rightKey = GLFW_KEY_RIGHT; | ||
28 | int jumpKey = GLFW_KEY_UP; | ||
29 | int dropKey = GLFW_KEY_DOWN; | ||
30 | |||
31 | bool frozen = false; | ||
32 | bool holdingLeft = false; | ||
33 | bool holdingRight = false; | ||
34 | }; | ||
35 | |||
36 | #endif /* end of include guard: CONTROLLABLE_H_4E0B85B4 */ | ||