aboutsummaryrefslogtreecommitdiff
path: root/game/player/PlayerEndScript.cpp
diff options
context:
space:
mode:
authorMax-001 <maxsmits21@kpnmail.nl>2025-01-08 09:52:00 +0100
committerMax-001 <maxsmits21@kpnmail.nl>2025-01-08 09:52:00 +0100
commitb1824253875901b4fb6f4c5fee72aea6d807d370 (patch)
tree8acc156e68d48022f453dcf06b541f77a5803484 /game/player/PlayerEndScript.cpp
parente9082de7d114ce024a884cac38c545c99de4026a (diff)
parente75ca1c947f3cde19bebf15049732bc069c6e913 (diff)
Merge remote-tracking branch 'origin/master' into max/game2
Diffstat (limited to 'game/player/PlayerEndScript.cpp')
-rw-r--r--game/player/PlayerEndScript.cpp7
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;