From c980854663a2fe5bcb66f1c120012ce651081277 Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Wed, 31 Aug 2022 16:08:50 -0500 Subject: [PATCH] Correctly size zone colliders so they connect with neighbors. --- src/map.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/map.rs b/src/map.rs index b97e6f2..4a896b4 100644 --- a/src/map.rs +++ b/src/map.rs @@ -215,7 +215,10 @@ fn spawn_colliders( } } for room in &map.rooms { - let shape = Collider::cuboid((room.width() / 2) as f32, (room.height() / 2) as f32); + let shape = Collider::cuboid( + (room.width() / 2) as f32 + 0.5, + (room.height() / 2) as f32 + 0.5, + ); let position = Isometry2::new(Vector2::new(room.center().x(), room.center().y()), 0.); let aabb = shape.raw.compute_aabb(&position);