From 4eb68c5f5672ed9b5746cc09249dddc804ebd37d Mon Sep 17 00:00:00 2001 From: Max-001 Date: Wed, 8 Jan 2025 18:50:22 +0100 Subject: Background paralax fix at boss fight --- game/scheduler/ObjectsScheduler.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'game') 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("camera").front().get().data.linear_velocity.x = 0; this->get_components_by_name("player").front().get().data.linear_velocity.x = 0; this->trigger_event(BattleStartEvent {.num_enemies = 2}); + + RefVector rb_back_forest + = this->get_components_by_tag("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("player").front().get().data.linear_velocity.x = PLAYER_SPEED * 0.02; + + RefVector rb_back_forest + = this->get_components_by_tag("forest_background"); + rb_back_forest.front().get().data.linear_velocity.x = 30; + rb_back_forest.back().get().data.linear_velocity.x = 40; + return false; } -- cgit v1.2.3