diff options
-rw-r--r-- | game/player/PlayerEndScript.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/game/player/PlayerEndScript.cpp b/game/player/PlayerEndScript.cpp index 047dbb0..4ae813f 100644 --- a/game/player/PlayerEndScript.cpp +++ b/game/player/PlayerEndScript.cpp @@ -62,7 +62,9 @@ bool PlayerEndScript::on_collision(const crepe::CollisionEvent & ev) { rb_player.data.angular_velocity = 0; rb_player.data.elasticity_coefficient = 0; - rb_player.data.linear_velocity = vec2(PLAYER_SPEED * dt, 0); + if (rb_player.data.linear_velocity.x != 0) { + rb_player.data.linear_velocity = vec2(PLAYER_SPEED * dt, 0); + } rb_player.data.linear_velocity_coefficient = vec2(0.5, 0.5); rb_camera.data.linear_velocity_coefficient = vec2(0.5, 0.5); for (Animator & anim : anim_player) { |