public void Update(SpaceShip Player, Time Elapsed) { if (MathHelper.GetDistance(Player.Position, ship.Position) >= 1000) { return; } //ship.GetInRange(Player); ship.Update(Elapsed); }
public void GetInRange(SpaceShip Target) { if (MathHelper.GetDistance(ship.Position, destination) > ShortRangeDistance) { velocity = (Single)Math.Min(1.0, velocity + (0.5f * Time.FromSeconds(1.0f / 60.0f).AsMilliseconds()) / mass); } else { velocity = (Single)Math.Max(0.2f, velocity - (0.5f * Time.FromSeconds(1.0f / 60.0f).AsMilliseconds()) / mass); } direction = Target.Position - ship.Position; }
public AI(HostileSpace Game, SpaceShip Ship) : base(Game) { ship = Ship; }