aboutsummaryrefslogtreecommitdiff
path: root/game/scheduler/ObjectsScheduler.cpp
diff options
context:
space:
mode:
authorheavydemon21 <nielsstunnebrink1@gmail.com>2025-01-10 19:18:54 +0100
committerheavydemon21 <nielsstunnebrink1@gmail.com>2025-01-10 19:18:54 +0100
commite0054137a49927dc619ca1a94ca543ae01713e3c (patch)
tree366bc8f475c6b98030254f9ec7c64e3ad1f1064a /game/scheduler/ObjectsScheduler.cpp
parent00086eaffe2c9c75ebad07eb77f1cc6198104adf (diff)
parent20f6f8ddf013e5d18770bd0a01474a845843bdd7 (diff)
Merge branch 'master' into niels/game
Diffstat (limited to 'game/scheduler/ObjectsScheduler.cpp')
-rw-r--r--game/scheduler/ObjectsScheduler.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/game/scheduler/ObjectsScheduler.cpp b/game/scheduler/ObjectsScheduler.cpp
index 3ce2018..36bf901 100644
--- a/game/scheduler/ObjectsScheduler.cpp
+++ b/game/scheduler/ObjectsScheduler.cpp
@@ -37,10 +37,18 @@ bool ObjectsScheduler::boss_fight_1_event() {
this->get_components_by_name<Rigidbody>("player").front().get().data.linear_velocity.x
= PLAYER_SPEED * 0.02;
+ bool first = true;
RefVector<Rigidbody> rb_back_forest
= this->get_components_by_tag<Rigidbody>("forest_background");
- rb_back_forest.front().get().data.linear_velocity.x = 30;
- rb_back_forest.back().get().data.linear_velocity.x = 40;
+ for (Rigidbody & rb : rb_back_forest) {
+ if (first == true) {
+ rb.data.linear_velocity.x = 30;
+ first = false;
+ } else {
+ rb.data.linear_velocity.x = 40;
+ first = true;
+ }
+ }
return false;
}