示例#1
0
        public void Update(SpaceShip Player, Time Elapsed)
        {
            if (MathHelper.GetDistance(Player.Position, ship.Position) >= 1000)
            {
                return;
            }

            //ship.GetInRange(Player);

            ship.Update(Elapsed);
        }
示例#2
0
        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;
        }
示例#3
0
 public AI(HostileSpace Game, SpaceShip Ship)
     : base(Game)
 {
     ship = Ship;
 }