diff options
author | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2025-01-10 14:50:50 +0100 |
---|---|---|
committer | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2025-01-10 14:50:50 +0100 |
commit | 7aa07561a52016007ff852acefa4db68260f0f1e (patch) | |
tree | ac438e906e581ee68f9d065dea90a2cbb8436d15 /game/player/PlayerScript.cpp | |
parent | d7c8cc30e1d37526cf142f950038500b96760514 (diff) | |
parent | 0f8bf257d86b5532f3d6f559e5368668c255af7c (diff) |
Merge branch 'master' of https://github.com/lonkaars/crepe into wouter/game-improvements
Diffstat (limited to 'game/player/PlayerScript.cpp')
-rw-r--r-- | game/player/PlayerScript.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/game/player/PlayerScript.cpp b/game/player/PlayerScript.cpp index 0fadade..8cbe8dc 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; } |