diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2025-01-08 16:20:10 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2025-01-08 16:20:10 +0100 |
commit | bb976ed881a989b8b2cec90c905d906d9b652a9d (patch) | |
tree | e0125ba5141542b2000125bda76495f0098a1e41 /game/scheduler | |
parent | 8edce6775ab0639a2a6eee3e561d3de0bb0c2cf1 (diff) |
`make format`
Diffstat (limited to 'game/scheduler')
-rw-r--r-- | game/scheduler/ObjectsScheduler.cpp | 12 | ||||
-rw-r--r-- | game/scheduler/ObjectsScheduler.h | 6 |
2 files changed, 8 insertions, 10 deletions
diff --git a/game/scheduler/ObjectsScheduler.cpp b/game/scheduler/ObjectsScheduler.cpp index 02d84c1..fca8fa2 100644 --- a/game/scheduler/ObjectsScheduler.cpp +++ b/game/scheduler/ObjectsScheduler.cpp @@ -2,8 +2,8 @@ #include "ObjectsScheduler.h" -#include "../Random.h" #include "../Config.h" +#include "../Random.h" #include "../missile/SpawnEvent.h" #include "api/Rigidbody.h" #include "api/Transform.h" @@ -16,15 +16,17 @@ 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() { +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 = 2}); + this->trigger_event<BattleStartEvent>(BattleStartEvent {.num_enemies = 2}); } bool ObjectsScheduler::boss_fight_1_event() { - this->get_components_by_name<Rigidbody>("camera").front().get().data.linear_velocity.x = PLAYER_SPEED * 0.02; - this->get_components_by_name<Rigidbody>("player").front().get().data.linear_velocity.x = PLAYER_SPEED * 0.02; + this->get_components_by_name<Rigidbody>("camera").front().get().data.linear_velocity.x + = PLAYER_SPEED * 0.02; + this->get_components_by_name<Rigidbody>("player").front().get().data.linear_velocity.x + = PLAYER_SPEED * 0.02; return false; } diff --git a/game/scheduler/ObjectsScheduler.h b/game/scheduler/ObjectsScheduler.h index 56d72cb..bd0701b 100644 --- a/game/scheduler/ObjectsScheduler.h +++ b/game/scheduler/ObjectsScheduler.h @@ -1,17 +1,14 @@ #pragma once - - #include "api/Script.h" #include <functional> #include <vector> - class ObjectsScheduler : public crepe::Script { private: std::vector<std::function<void()>> obstacles; - + int last_boss_check = 0; int last_obstacle_check = 0; @@ -32,5 +29,4 @@ private: public: void init(); void fixed_update(crepe::duration_t dt); - }; |