remove collisions
This commit is contained in:
parent
57bfba8bee
commit
c977f355f8
@ -1,19 +0,0 @@
|
|||||||
use crate::prelude::*;
|
|
||||||
|
|
||||||
#[system]
|
|
||||||
#[read_component(Point)]
|
|
||||||
#[read_component(Player)]
|
|
||||||
#[read_component(Enemy)]
|
|
||||||
pub fn collisions(ecs: &mut SubWorld, commands: &mut CommandBuffer) {
|
|
||||||
let mut player_pos = Point::zero();
|
|
||||||
let mut players = <&Point>::query().filter(component::<Player>());
|
|
||||||
players.iter(ecs).for_each(|pos| player_pos = *pos);
|
|
||||||
|
|
||||||
let mut enemies = <(Entity, &Point)>::query().filter(component::<Enemy>());
|
|
||||||
enemies
|
|
||||||
.iter(ecs)
|
|
||||||
.filter(|(_, pos)| **pos == player_pos)
|
|
||||||
.for_each(|(entity, _)| {
|
|
||||||
commands.remove(*entity);
|
|
||||||
});
|
|
||||||
}
|
|
@ -1,5 +1,4 @@
|
|||||||
use crate::prelude::*;
|
use crate::prelude::*;
|
||||||
mod collisions;
|
|
||||||
mod end_turn;
|
mod end_turn;
|
||||||
mod entity_render;
|
mod entity_render;
|
||||||
mod hud;
|
mod hud;
|
||||||
@ -23,8 +22,6 @@ pub fn player_build_scheduler() -> Schedule {
|
|||||||
Schedule::builder()
|
Schedule::builder()
|
||||||
.add_system(movement::movement_system())
|
.add_system(movement::movement_system())
|
||||||
.flush()
|
.flush()
|
||||||
.add_system(collisions::collisions_system())
|
|
||||||
.flush()
|
|
||||||
.add_system(map_render::map_render_system())
|
.add_system(map_render::map_render_system())
|
||||||
.add_system(entity_render::entity_render_system())
|
.add_system(entity_render::entity_render_system())
|
||||||
.add_system(hud::hud_system())
|
.add_system(hud::hud_system())
|
||||||
@ -37,8 +34,6 @@ pub fn monster_build_scheduler() -> Schedule {
|
|||||||
.flush()
|
.flush()
|
||||||
.add_system(movement::movement_system())
|
.add_system(movement::movement_system())
|
||||||
.flush()
|
.flush()
|
||||||
.add_system(collisions::collisions_system())
|
|
||||||
.flush()
|
|
||||||
.add_system(map_render::map_render_system())
|
.add_system(map_render::map_render_system())
|
||||||
.add_system(entity_render::entity_render_system())
|
.add_system(entity_render::entity_render_system())
|
||||||
.add_system(hud::hud_system())
|
.add_system(hud::hud_system())
|
||||||
|
Loading…
Reference in New Issue
Block a user