aboutsummaryrefslogtreecommitdiff
path: root/game/scheduler
diff options
context:
space:
mode:
authorMax-001 <maxsmits21@kpnmail.nl>2025-01-10 17:07:28 +0100
committerMax-001 <maxsmits21@kpnmail.nl>2025-01-10 17:07:28 +0100
commit912774706bab1e7817facb3cff12e961a89d1980 (patch)
tree0896b12c29dccc247c69e54daaa32d8ce3097ed0 /game/scheduler
parent90a33d36c34b1512270a6724564995dd8bf914a6 (diff)
parent7aa07561a52016007ff852acefa4db68260f0f1e (diff)
Merge remote-tracking branch 'origin/wouter/game-improvements' into max/game2
Diffstat (limited to 'game/scheduler')
-rw-r--r--game/scheduler/ObjectsScheduler.cpp26
1 files changed, 23 insertions, 3 deletions
diff --git a/game/scheduler/ObjectsScheduler.cpp b/game/scheduler/ObjectsScheduler.cpp
index 36bf901..0839fe5 100644
--- a/game/scheduler/ObjectsScheduler.cpp
+++ b/game/scheduler/ObjectsScheduler.cpp
@@ -4,6 +4,7 @@
#include "../Config.h"
#include "../Random.h"
+#include "../enemy/EnemyScript.h"
#include "../missile/SpawnEvent.h"
#include "api/Rigidbody.h"
#include "api/Transform.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(2, 0),
+ .battle = false,
+ });
+}
+void ObjectsScheduler::preset_1() {
+ trigger_event<MissileSpawnEvent>(MissileSpawnEvent {});
+ this->trigger_event<BattleStartEvent>(BattleStartEvent {
+ .num_enemies = Random::i(2, 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 = 5,
+ .battle = true,
+ });
RefVector<Rigidbody> rb_back_forest
= this->get_components_by_tag<Rigidbody>("forest_background");