Пример #1
0
 public override void Update(GameTime gameTime, WorldHandler world)
 {
     timer += gameTime.ElapsedGameTime.Milliseconds;
     base.Update(gameTime, world);
     if (timer / 1000 >= 1)
     {
         UnitInteraction(world);
     }
     if (waypoints.Count() > 0 && Vector2.Distance(Position, TargetPosition + DistanceFromPosition) < stats[typeof(Range)].Value)
     {
         waypoints.Clear();
     }
     if (timer / 1000 >= 1)
     {
         if (Target != null && Target.Position.ToPoint() != TargetPosition.ToPoint()) // Keeps tracking the units
         {
             Move(Target.Position, world);
         }
         timer = 0;
     }
 }