Compare commits
No commits in common. "0a28702b2ae791b54b05d2db9ad9cf0d1d3f19d5" and "aeb80394633b5c9de27fb58765d7f5a41ff58a96" have entirely different histories.
0a28702b2a
...
aeb8039463
18
src/map.rs
18
src/map.rs
|
@ -220,8 +220,8 @@ fn spawn_colliders<D: 'static + Clone + Default + Send + Sync>(
|
||||||
let position =
|
let position =
|
||||||
Isometry2::new(Vector2::new(room.center().x(), room.center().y()), 0.);
|
Isometry2::new(Vector2::new(room.center().x(), room.center().y()), 0.);
|
||||||
let aabb = shape.raw.compute_aabb(&position);
|
let aabb = shape.raw.compute_aabb(&position);
|
||||||
commands.entity(map_entity).with_children(|parent| {
|
let id = commands
|
||||||
parent.spawn((
|
.spawn((
|
||||||
TransformBundle::from_transform(Transform::from_xyz(
|
TransformBundle::from_transform(Transform::from_xyz(
|
||||||
position.translation.x,
|
position.translation.x,
|
||||||
position.translation.y,
|
position.translation.y,
|
||||||
|
@ -232,8 +232,9 @@ fn spawn_colliders<D: 'static + Clone + Default + Send + Sync>(
|
||||||
ActiveEvents::COLLISION_EVENTS,
|
ActiveEvents::COLLISION_EVENTS,
|
||||||
Area(aabb),
|
Area(aabb),
|
||||||
Zone,
|
Zone,
|
||||||
));
|
))
|
||||||
});
|
.id();
|
||||||
|
commands.entity(map_entity).push_children(&[id]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -279,12 +280,13 @@ fn spawn_portals<D: 'static + Clone + Default + Send + Sync>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (x, y) in portals {
|
for (x, y) in portals {
|
||||||
commands.entity(map_entity).with_children(|parent| {
|
let portal = commands
|
||||||
parent.spawn(PortalBundle {
|
.spawn(PortalBundle {
|
||||||
transform: Transform::from_translation(Vec3::new(x, y, 0.)),
|
transform: Transform::from_translation(Vec3::new(x, y, 0.)),
|
||||||
..default()
|
..default()
|
||||||
});
|
})
|
||||||
});
|
.id();
|
||||||
|
commands.entity(map_entity).push_children(&[portal]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user