diff options
author | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2025-01-09 14:46:30 +0100 |
---|---|---|
committer | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2025-01-09 14:46:30 +0100 |
commit | 7739a80176cea889ce240d18d354c5174825b25a (patch) | |
tree | e61974e217791cd86f519bf1c4cfd3b082d55166 /game/scheduler | |
parent | 8b32dbc33c434f84b4aab98819147c3b8416ff69 (diff) |
workers during normal sequence working
Diffstat (limited to 'game/scheduler')
-rw-r--r-- | game/scheduler/ObjectsScheduler.cpp | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/game/scheduler/ObjectsScheduler.cpp b/game/scheduler/ObjectsScheduler.cpp index 3ce2018..a802806 100644 --- a/game/scheduler/ObjectsScheduler.cpp +++ b/game/scheduler/ObjectsScheduler.cpp @@ -5,6 +5,7 @@ #include "../Config.h" #include "../Random.h" #include "../missile/SpawnEvent.h" +#include "../enemy/EnemyScript.h" #include "api/Rigidbody.h" #include "api/Transform.h" #include "enemy/BattleScript.h" @@ -14,15 +15,34 @@ using namespace crepe; void ObjectsScheduler::preset_0() { trigger_event<MissileSpawnEvent>(MissileSpawnEvent {}); trigger_event<MissileSpawnEvent>(MissileSpawnEvent {}); + this->trigger_event<BattleStartEvent>(BattleStartEvent { + .num_enemies = Random::i(3,1), + .battle = false, + }); +} +void ObjectsScheduler::preset_1() { + trigger_event<MissileSpawnEvent>(MissileSpawnEvent {}); + this->trigger_event<BattleStartEvent>(BattleStartEvent { + .num_enemies = Random::i(4,1), + .battle = false, + }); +} +void ObjectsScheduler::preset_2() { + trigger_event<CreateZapperEvent>(CreateZapperEvent {}); + this->trigger_event<BattleStartEvent>(BattleStartEvent { + .num_enemies = Random::i(2,1), + .battle = false, + }); } -void ObjectsScheduler::preset_1() { trigger_event<MissileSpawnEvent>(MissileSpawnEvent {}); } -void ObjectsScheduler::preset_2() { trigger_event<CreateZapperEvent>(CreateZapperEvent {}); } void ObjectsScheduler::preset_3() { trigger_event<CreateZapperEvent>(CreateZapperEvent {}); } void ObjectsScheduler::preset_4() {} 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 = 7, + .battle = true, + }); RefVector<Rigidbody> rb_back_forest = this->get_components_by_tag<Rigidbody>("forest_background"); |