From ccc7dd1f167daf869fb91118bd3fca8ea796fc8d Mon Sep 17 00:00:00 2001 From: max-001 Date: Mon, 16 Dec 2024 14:45:32 +0100 Subject: Fixed parallax --- src/example/game.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/example/game.cpp b/src/example/game.cpp index 62e7732..cfa9d5e 100644 --- a/src/example/game.cpp +++ b/src/example/game.cpp @@ -36,13 +36,13 @@ public: = this->get_components_by_name("forest_bg_3_" + name); for (Transform & t : vec_2) { - if (t.position.x < begin_x - 400) { - t.position.x = end_x - 400; + if (t.position.x > end_x - 400) { + t.position.x = begin_x - 400; } } for (Transform & t : vec_3) { - if (t.position.x < begin_x - 400) { - t.position.x = end_x - 400; + if (t.position.x > end_x - 400) { + t.position.x = begin_x - 400; } } } @@ -346,10 +346,10 @@ public: }); bg_2.add_component(Rigidbody::Data{ - .linear_velocity = vec2(-0.5, 0), + .linear_velocity = vec2(0.3, 0), }); bg_3.add_component(Rigidbody::Data{ - .linear_velocity = vec2(-0.25, 0), + .linear_velocity = vec2(0.4, 0), }); } -- cgit v1.2.3