aboutsummaryrefslogtreecommitdiff
path: root/game/player
diff options
context:
space:
mode:
authorMax-001 <maxsmits21@kpnmail.nl>2025-01-06 10:14:58 +0100
committerMax-001 <maxsmits21@kpnmail.nl>2025-01-06 10:14:58 +0100
commitb31934cc6867be10e986a4bd4d0ab81dc91d56ec (patch)
tree7649286b2f773b517f9de9c2a220fbc122d5548d /game/player
parentdb12396d0033df612d1cd1cd161b716d4c508fa7 (diff)
Paralax stops when player stops
Diffstat (limited to 'game/player')
-rw-r--r--game/player/PlayerEndScript.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/game/player/PlayerEndScript.cpp b/game/player/PlayerEndScript.cpp
index 8833c28..4cd2cd0 100644
--- a/game/player/PlayerEndScript.cpp
+++ b/game/player/PlayerEndScript.cpp
@@ -50,6 +50,12 @@ bool PlayerEndScript::on_collision(const crepe::CollisionEvent & ev) {
} else if (jump == 1) {
jump++;
} else if (jump == 2) {
+ RefVector<Rigidbody> rb_back_forest
+ = this->get_components_by_tag<Rigidbody>("forest_background");
+ for (Rigidbody & rb : rb_back_forest) {
+ rb.data.linear_velocity_coefficient = vec2(0.5, 0.5);
+ }
+
rb_player.data.angular_velocity = 0;
rb_player.data.elasticity_coefficient = 0;
rb_player.data.linear_velocity = vec2(PLAYER_SPEED, 0);