Fix typo and shrink colliders to minimize spawning warnings.

This commit is contained in:
Nolan Darilek 2024-12-04 17:40:25 -06:00
parent ed10eabb63
commit 478644491a

View File

@ -98,7 +98,7 @@ impl Default for TileBundle {
fn default() -> Self { fn default() -> Self {
Self { Self {
transform: default(), transform: default(),
collider: Collider::rectangle(1., 1.), collider: Collider::rectangle(0.99, 0.99),
rigid_body: RigidBody::Static, rigid_body: RigidBody::Static,
map_obstruction: default(), map_obstruction: default(),
} }
@ -135,10 +135,7 @@ impl ZoneBundle {
impl From<&MRect> for ZoneBundle { impl From<&MRect> for ZoneBundle {
fn from(rect: &MRect) -> Self { fn from(rect: &MRect) -> Self {
let collider = Collider::rectangle( let collider = Collider::rectangle(rect.width() as f32 + 1., rect.height() as f32 + 1.);
rect.width() as f32 + 1.,
rect.height() as f32 + 0.1,
);
let position = Vec2::new(rect.center().x(), rect.center().y()); let position = Vec2::new(rect.center().x(), rect.center().y());
Self::new(collider, position) Self::new(collider, position)
} }