aboutsummaryrefslogtreecommitdiff
path: root/game/player
diff options
context:
space:
mode:
authorMax-001 <maxsmits21@kpnmail.nl>2025-01-10 14:44:42 +0100
committerMax-001 <maxsmits21@kpnmail.nl>2025-01-10 14:44:42 +0100
commit5203994b55aa51d5034c30001e0dac66efe2f14b (patch)
tree3a81183c51b7966dd4a872579ee080ee38e2236d /game/player
parentbb2db93bfb8dd7e080d2708548eae660e6b33913 (diff)
Fixed issue that Player is lifted up when any key is pressed
Diffstat (limited to 'game/player')
-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;
}