Skip to content
Snippets Groups Projects
Commit 6a472d46 authored by Florian Schröder's avatar Florian Schröder
Browse files

Merge branch...

Merge branch '45-fix-player-collision-can-push-other-players-into-each-others-can-push-players-out-of-the-world' into 'main'

Resolve "Fix player collision: Can push other players into each others, can push players out of the world"

Closes #45

See merge request scs/cocosy/overcooked-simulator!16
parents a3332c95 6a45fe15
No related branches found
No related tags found
1 merge request!16Resolve "Fix player collision: Can push other players into each others, can push players out of the world"
Pipeline #42260 passed
......@@ -229,10 +229,10 @@ class Environment:
pushing_vector = pushing_vector / np.linalg.norm(pushing_vector)
old_pos_other = collided_player.pos.copy()
collided_player.move(pushing_vector * (collided_player.move_dist / 2))
self.perform_movement(collided_player, pushing_vector)
if self.detect_collision_counters(
collided_player
) or self.detect_collision_world_bounds(player):
) or self.detect_collision_world_bounds(collided_player):
collided_player.move_abs(old_pos_other)
player.move_abs(old_pos)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment