Compare commits

...

2 Commits

Author SHA1 Message Date
2d00bbb2db Add implementation of PointLike for &Destination.
All checks were successful
continuous-integration/drone/push Build is passing
2022-07-18 11:53:33 -05:00
410b07826c Add Zone component on rooms. 2022-07-18 11:52:48 -05:00
2 changed files with 8 additions and 3 deletions

View File

@ -65,6 +65,10 @@ impl Default for SpawnPortals {
}
}
#[derive(Default, Component, Clone, Debug, Reflect)]
#[reflect(Component)]
pub struct Zone;
pub trait ITileType {
fn blocks_motion(&self) -> bool;
fn blocks_visibility(&self) -> bool;
@ -236,13 +240,13 @@ fn spawn_colliders<D: 'static + Clone + Default + Send + Sync>(
.insert(shape)
.insert(Sensor)
.insert(ActiveEvents::COLLISION_EVENTS)
.insert(Transform::from_xyz(
.insert_bundle(TransformBundle::from_transform(Transform::from_xyz(
position.translation.x,
position.translation.y,
0.,
))
.insert(GlobalTransform::default())
)))
.insert(Area(aabb))
.insert(Zone)
.id();
commands.entity(map_entity).push_children(&[id]);
}

View File

@ -29,6 +29,7 @@ struct Calculating(Task<Option<Path>>);
pub struct Destination(pub (i32, i32));
impl_pointlike_for_tuple_component!(Destination);
impl_pointlike_for_tuple_component!(&Destination);
#[derive(Component, Clone, Debug, Default, Reflect)]
#[reflect(Component)]