aboutsummaryrefslogtreecommitdiff
path: root/game/scheduler
diff options
context:
space:
mode:
authorheavydemon21 <nielsstunnebrink1@gmail.com>2025-01-08 15:57:05 +0100
committerheavydemon21 <nielsstunnebrink1@gmail.com>2025-01-08 15:57:05 +0100
commit1ec7e724fcace1274473dfcae91022cc1c930baa (patch)
tree1508e8cd74588f388093dae81432fa66ecd436f2 /game/scheduler
parentce83df284173cfb4f6e430bf3ed8080ea21204d7 (diff)
working scheduler and enemies and rest
Diffstat (limited to 'game/scheduler')
-rw-r--r--game/scheduler/ObjectsScheduler.cpp8
-rw-r--r--game/scheduler/ObjectsScheduler.h4
2 files changed, 5 insertions, 7 deletions
diff --git a/game/scheduler/ObjectsScheduler.cpp b/game/scheduler/ObjectsScheduler.cpp
index 11bb111..02d84c1 100644
--- a/game/scheduler/ObjectsScheduler.cpp
+++ b/game/scheduler/ObjectsScheduler.cpp
@@ -9,7 +9,6 @@
#include "api/Transform.h"
#include "enemy/BattleScript.h"
#include "prefab/ZapperPoolSubScene.h"
-#include <iostream>
using namespace crepe;
void ObjectsScheduler::preset_0() { trigger_event<MissileSpawnEvent>(MissileSpawnEvent {}); }
@@ -20,13 +19,12 @@ 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 = 5});
+ 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;
- this->get_components_by_name<Rigidbody>("player").front().get().data.linear_velocity.x = PLAYER_SPEED;
+ 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 1bd0940..56d72cb 100644
--- a/game/scheduler/ObjectsScheduler.h
+++ b/game/scheduler/ObjectsScheduler.h
@@ -15,8 +15,8 @@ private:
int last_boss_check = 0;
int last_obstacle_check = 0;
- int boss_fight_interval = 1000;
- int obstacle_interval = 3000;
+ int boss_fight_interval = 5000;
+ int obstacle_interval = 350;
int start_offset = 1300;
private: