Smoother pathfinding for fast animals

This commit is contained in:
Joshua Barretto
2020-07-04 01:17:51 +01:00
committed by jshipsey
parent 014cab0257
commit 8a0b7fd173
4 changed files with 60 additions and 38 deletions

View File

@ -78,7 +78,11 @@ impl Component for Agent {
#[derive(Clone, Debug)]
pub enum Activity {
Idle(Vec2<f32>),
Follow(EcsEntity, Chaser),
Follow {
target: EcsEntity,
chaser: Chaser,
move_dir: Vec2<f32>,
},
Attack {
target: EcsEntity,
chaser: Chaser,
@ -91,7 +95,7 @@ pub enum Activity {
impl Activity {
pub fn is_follow(&self) -> bool {
match self {
Activity::Follow(_, _) => true,
Activity::Follow { .. } => true,
_ => false,
}
}