aboutsummaryrefslogtreecommitdiff
path: root/game/player/PlayerEndScript.cpp
diff options
context:
space:
mode:
authorJAROWMR <jarorutjes07@gmail.com>2025-01-09 21:15:06 +0100
committerJAROWMR <jarorutjes07@gmail.com>2025-01-09 21:15:06 +0100
commit5863e43cdbf19738dabbd285e92622d740c72f71 (patch)
tree77e2af84b538498e5de2113d18dd3ee10c6139bc /game/player/PlayerEndScript.cpp
parentf6683fa71fa670cfbe6aa6233fafb869295da11a (diff)
parent8b32dbc33c434f84b4aab98819147c3b8416ff69 (diff)
Merge branch 'master' of github.com:lonkaars/crepe into jaro/game
Diffstat (limited to 'game/player/PlayerEndScript.cpp')
-rw-r--r--game/player/PlayerEndScript.cpp4
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) {