diff --git a/src/map.rs b/src/map.rs index cb0eec4..afb9d9b 100644 --- a/src/map.rs +++ b/src/map.rs @@ -313,17 +313,18 @@ fn spawn_colliders( "Top left: {:?}\ntop right: {:?}\nbottom left: {:?}\nbottom right: {:?}", top_left, top_right, bl, br );*/ - let center = (bl.0 as f32 + half_width, br.1 as f32 + half_height); - let x = center.0; - let y = center.1; + let center = ( + bl.0 as f32 + half_width + 0.5, + br.1 as f32 + half_height + 0.5, + ); /*println!( - "Create shape at {:?} of width {} and height {}", + "Create shape at {:?} of width {:?} and height {:?}", center, width, height );*/ let id = commands .spawn_bundle(ColliderBundle { shape: ColliderShape::cuboid(half_width, half_height).into(), - position: Vec2::new(x, y).into(), + position: Vec2::new(center.x(), center.y()).into(), ..Default::default() }) .insert(MapObstruction)