From fcae8934916c9f429e58c8e178ab14fcf65a2bbc Mon Sep 17 00:00:00 2001 From: JAROWMR Date: Tue, 7 Jan 2025 11:20:58 +0100 Subject: added end game --- game/player/PlayerEndScript.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'game/player') diff --git a/game/player/PlayerEndScript.cpp b/game/player/PlayerEndScript.cpp index e04fb9d..1554c84 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 @@ -89,6 +90,10 @@ bool PlayerEndScript::on_collision(const crepe::CollisionEvent & ev) { jump++; } + if(rb_player.data.linear_velocity.x < 5){ + this->trigger_event(); + } + return true; } -- cgit v1.2.3