示例#1
0
        } // Carrier

        public override void Update(GameTime gameTime)
        {
            if (Fighters.Count < FighterHangar)
            {
                FighterBuildTime -= (float)gameTime.ElapsedGameTime.TotalMilliseconds;

                if (FighterBuildTime <= 0)
                {
                    var newFighter = GameplayState.UnitManager.SpawnShip(ShipType.Fighter, Position + new Vector2(WorldData.RNG.Next(-50, 50), WorldData.RNG.Next(-50, 50)), this);
                    newFighter.IsSelectable = false;
                    Fighters.Add((Fighter)newFighter);

                    FighterBuildTime = FighterData.BuildTime;
                }
            }

            if (Bombers.Count < BomberHangar)
            {
                BomberBuildTime -= (float)gameTime.ElapsedGameTime.TotalMilliseconds;

                if (BomberBuildTime <= 0)
                {
                    var newBomber = GameplayState.UnitManager.SpawnShip(ShipType.Bomber, Position + new Vector2(WorldData.RNG.Next(-50, 50), WorldData.RNG.Next(-50, 50)), this);
                    newBomber.IsSelectable = false;
                    Bombers.Add((Bomber)newBomber);

                    BomberBuildTime = BomberData.BuildTime;
                }
            }

            AIHelper.BigWarshipAI(this, gameTime);
            base.Update(gameTime);
        } // Update
示例#2
0
 public override void Update(GameTime gameTime)
 {
     AIHelper.BigWarshipAI(this, gameTime);
     base.Update(gameTime);
 }