aboutsummaryrefslogtreecommitdiff
path: root/game/player/PlayerEndScript.cpp
diff options
context:
space:
mode:
authorWBoerenkamps <wrj.boerenkamps@student.avans.nl>2025-01-08 10:47:47 +0100
committerWBoerenkamps <wrj.boerenkamps@student.avans.nl>2025-01-08 10:47:47 +0100
commit65cdd7966c276dd7b1ffec7bf0de243b9370eeb1 (patch)
tree938c6ed098f2141a6a5c2d56146325938ae868bd /game/player/PlayerEndScript.cpp
parent6112da75f973b1099fa95fcd9d3113c00302f5b4 (diff)
parentad5fb53986fcc3f3b3c5369574e0f8e95051f3d9 (diff)
Merge branch 'master' of https://github.com/lonkaars/crepe into wouter/enemyAI
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 fc3b8a1..92e48e3 100644
--- a/game/player/PlayerEndScript.cpp
+++ b/game/player/PlayerEndScript.cpp
@@ -2,6 +2,7 @@
#include "PlayerEndScript.h"
#include "../Config.h"
+#include "../Events.h"
#include "manager/LoopTimerManager.h"
#include <crepe/api/Animator.h>
@@ -91,7 +92,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;