aboutsummaryrefslogtreecommitdiff
path: root/game
diff options
context:
space:
mode:
Diffstat (limited to 'game')
-rw-r--r--game/player/PlayerScript.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/game/player/PlayerScript.cpp b/game/player/PlayerScript.cpp
index c3843ca..286cdaf 100644
--- a/game/player/PlayerScript.cpp
+++ b/game/player/PlayerScript.cpp
@@ -30,14 +30,18 @@ void PlayerScript::init() {
}
bool PlayerScript::on_key_down(const KeyPressEvent & ev) {
- const vec2 UP = {0, -1};
- this->help_kick(UP);
+ if (ev.key == Keycode::SPACE) {
+ const vec2 UP = {0, -1};
+ this->help_kick(UP);
+ }
return false;
}
bool PlayerScript::on_key_up(const KeyReleaseEvent & ev) {
- const vec2 DOWN = {0, 1};
- this->help_kick(DOWN);
+ if (ev.key == Keycode::SPACE) {
+ const vec2 DOWN = {0, 1};
+ this->help_kick(DOWN);
+ }
return false;
}