diff options
author | JAROWMR <jarorutjes07@gmail.com> | 2025-01-07 11:20:58 +0100 |
---|---|---|
committer | JAROWMR <jarorutjes07@gmail.com> | 2025-01-07 11:20:58 +0100 |
commit | fcae8934916c9f429e58c8e178ab14fcf65a2bbc (patch) | |
tree | 34cddb9fad2c8639dfed3ffbb3216be9ac5e8b52 /game/player | |
parent | 126c402548281f3a97e3a9e0ef60c45147c87fa0 (diff) |
added end game
Diffstat (limited to 'game/player')
-rw-r--r-- | game/player/PlayerEndScript.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
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 <crepe/api/Animator.h> @@ -89,6 +90,10 @@ bool PlayerEndScript::on_collision(const crepe::CollisionEvent & ev) { jump++; } + if(rb_player.data.linear_velocity.x < 5){ + this->trigger_event<EndGameEvent>(); + } + return true; } |