diff options
author | Max-001 <maxsmits21@kpnmail.nl> | 2025-01-08 18:50:22 +0100 |
---|---|---|
committer | Max-001 <maxsmits21@kpnmail.nl> | 2025-01-08 18:50:22 +0100 |
commit | 4eb68c5f5672ed9b5746cc09249dddc804ebd37d (patch) | |
tree | fb07d1c05eddec3588eb77d6337cfc87b5c80d68 /game/scheduler/ObjectsScheduler.cpp | |
parent | 6e19b17f36fc4371578a512f9fbda64125ca80c0 (diff) |
Background paralax fix at boss fight
Diffstat (limited to 'game/scheduler/ObjectsScheduler.cpp')
-rw-r--r-- | game/scheduler/ObjectsScheduler.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/game/scheduler/ObjectsScheduler.cpp b/game/scheduler/ObjectsScheduler.cpp index 60e3f47..3ce2018 100644 --- a/game/scheduler/ObjectsScheduler.cpp +++ b/game/scheduler/ObjectsScheduler.cpp @@ -23,6 +23,12 @@ 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}); + + RefVector<Rigidbody> rb_back_forest + = this->get_components_by_tag<Rigidbody>("forest_background"); + for (Rigidbody & rb : rb_back_forest) { + rb.data.linear_velocity.x = 0; + } } bool ObjectsScheduler::boss_fight_1_event() { @@ -30,6 +36,12 @@ bool ObjectsScheduler::boss_fight_1_event() { = PLAYER_SPEED * 0.02; this->get_components_by_name<Rigidbody>("player").front().get().data.linear_velocity.x = PLAYER_SPEED * 0.02; + + 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; + return false; } |