Better enemy AI targetting and combat

This commit is contained in:
Joshua Barretto 2019-08-04 08:58:41 +01:00
parent aea3712c01
commit 09074fd7ef

@ -108,7 +108,7 @@ impl<'a> System<'a> for Sys {
let entities = (&entities, &positions, &stats)
.join()
.filter(|(e, e_pos, e_stats)| {
Vec2::<f32>::from(e_pos.0 - pos.0).magnitude() < SIGHT_DIST
(e_pos.0 - pos.0).magnitude() < SIGHT_DIST
&& *e != entity
&& !e_stats.is_dead
})