diff options
author | Jaro <59013720+JaroWMR@users.noreply.github.com> | 2025-01-08 09:31:14 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-08 09:31:14 +0100 |
commit | e75ca1c947f3cde19bebf15049732bc069c6e913 (patch) | |
tree | cdaa7a2c06ffc7f41366d4106e16f254e3b9cdc5 /game/player/PlayerEndScript.cpp | |
parent | f31bd86ae5d7df21b788a273d4f2e530136ec184 (diff) | |
parent | 0d087f23affbdf5bcfb238bc9b9d3fc05b314c44 (diff) |
Merge pull request #101 from lonkaars/jaro/main-menu
Jaro/main menu
Diffstat (limited to 'game/player/PlayerEndScript.cpp')
-rw-r--r-- | game/player/PlayerEndScript.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/game/player/PlayerEndScript.cpp b/game/player/PlayerEndScript.cpp index e04fb9d..fb18f2f 100644 --- a/game/player/PlayerEndScript.cpp +++ b/game/player/PlayerEndScript.cpp @@ -1,6 +1,7 @@ #include "PlayerEndScript.h" #include "../Config.h" +#include "../Events.h" #include "manager/LoopTimerManager.h" #include <crepe/api/Animator.h> @@ -89,7 +90,11 @@ bool PlayerEndScript::on_collision(const crepe::CollisionEvent & ev) { jump++; } - return true; + if (rb_player.data.linear_velocity.x < 5) { + this->trigger_event<EndGameEvent>(); + } + + return false; } return false; |