diff options
author | heavydemon21 <48092678+heavydemon21@users.noreply.github.com> | 2025-01-10 14:48:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-10 14:48:39 +0100 |
commit | 0f8bf257d86b5532f3d6f559e5368668c255af7c (patch) | |
tree | 712d36dec5257a5524269dde85345ceaf90504d1 /game | |
parent | 798237b661e8e49284e78ffb1a16599cf6a46a6d (diff) | |
parent | bcf9bd69f173ecee0104c84e4eadc990f17569c6 (diff) |
Merge pull request #126 from lonkaars/max/game2
Bug fix + make format
Diffstat (limited to 'game')
-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 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; } |