summary refs log tree commit diff stats
path: root/src/components/controllable.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/controllable.h')
-rw-r--r--src/components/controllable.h36
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
7class 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 */