diff options
author | heavydemon21 <nielsstunnebrink1@gmail.com> | 2025-01-08 15:26:35 +0100 |
---|---|---|
committer | heavydemon21 <nielsstunnebrink1@gmail.com> | 2025-01-08 15:26:35 +0100 |
commit | 698628cf1fb1b8a1f68bf6a5672d984bd64be58f (patch) | |
tree | 627cd5caae6ec85ad237c50fcd9e3a560ca95d0e /game | |
parent | 17a587ee6ded6d51c678fcd89bf0d28dc60db43d (diff) |
added camera stop boss fight
Diffstat (limited to 'game')
-rw-r--r-- | game/scheduler/ObjectsScheduler.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/game/scheduler/ObjectsScheduler.cpp b/game/scheduler/ObjectsScheduler.cpp index 416a8da..11bb111 100644 --- a/game/scheduler/ObjectsScheduler.cpp +++ b/game/scheduler/ObjectsScheduler.cpp @@ -3,7 +3,9 @@ #include "ObjectsScheduler.h" #include "../Random.h" +#include "../Config.h" #include "../missile/SpawnEvent.h" +#include "api/Rigidbody.h" #include "api/Transform.h" #include "enemy/BattleScript.h" #include "prefab/ZapperPoolSubScene.h" @@ -15,10 +17,16 @@ void ObjectsScheduler::preset_1() { trigger_event<MissileSpawnEvent>(MissileSpaw void ObjectsScheduler::preset_2() { trigger_event<CreateZapperEvent>(CreateZapperEvent {}); } void ObjectsScheduler::preset_3() {} void ObjectsScheduler::preset_4() {} -void ObjectsScheduler::boss_fight_1() { trigger_event<BattleStartEvent>(BattleStartEvent {}); } +void ObjectsScheduler::boss_fight_1() { + this->get_components_by_name<Rigidbody>("camera").front().get().data.linear_velocity.x = 0; + this->get_components_by_name<Rigidbody>("player").front().get().data.linear_velocity.x = 0; + + this->trigger_event<BattleStartEvent>(BattleStartEvent{.num_enemies = 5}); +} bool ObjectsScheduler::boss_fight_1_event() { - std::cout << "BATTLE WON" << std::endl; + this->get_components_by_name<Rigidbody>("camera").front().get().data.linear_velocity.x = PLAYER_SPEED; + this->get_components_by_name<Rigidbody>("player").front().get().data.linear_velocity.x = PLAYER_SPEED; return false; } |