Пример #1
0
        public void AddAllianceToSector()
        {
            AllianceShip tempShip = new AllianceShip(game, spriteSheet);

            tempShip.Initialize(sector);
            overworld.AddOverworldObject(tempShip);
        }
Пример #2
0
        public void AddAllianceShip(Vector2 pos)
        {
            AllianceShip tmpShip = new AllianceShip(game, spriteSheet);

            tmpShip.Initialize();
            tmpShip.position = pos;;
            overworld.AddOverworldObject(tmpShip);
        }
Пример #3
0
        private void InitializeShips()
        {
            freighter = new FreighterShip(Game, Game.stateManager.shooterState.spriteSheet);
            freighter.Initialize(Game.stateManager.overworldState.GetSectorX,
                                 Game.stateManager.overworldState.GetStation("Soelara Station"),
                                 Game.stateManager.overworldState.GetStation("Fortrun Station"));

            alliance1          = new AllianceShip(Game, Game.stateManager.shooterState.spriteSheet);
            alliance1.SaveShip = false;
            alliance1.Initialize(Game.stateManager.overworldState.GetSectorX);
            alliance1.rotationSpeed = 2.5f;
            alliance1.speed         = 0.7f;

            rebelShips = new List <RebelShip>();

            for (int i = 0; i < numberOfRebelShips; i++)
            {
                CompositeAction actions = new SequentialAction();

                rebelShips.Add(new RebelShip(Game, Game.stateManager.shooterState.spriteSheet));
                rebelShips[i].Initialize();
                rebelShips[i].RemoveOnStationEnter = false;
                rebelShips[i].position             = new Vector2(destination.X + (i * 50), destination.Y);
                rebelShips[i].collisionEvent       = null;
                rebelShips[i].SaveShip             = false;

                actions.Add(new WaitAction(rebelShips[i],
                                           delegate
                {
                    return(ObjectiveIndex >= 7);
                }));

                actions.Add(new TravelAction(rebelShips[i], freighter));
                switch (i)
                {
                case 0:
                    actions.Add(new TravelAction(rebelShips[i], Game.stateManager.overworldState.GetSectorX.GetGameObject("Lavis")));
                    break;

                case 1:
                    actions.Add(new TravelAction(rebelShips[i], Game.stateManager.overworldState.GetStation("Rebel Base")));
                    break;

                case 2:
                    actions.Add(new TravelAction(rebelShips[i], Game.stateManager.overworldState.GetPlanet("New Norrland")));
                    break;
                }

                rebelShips[i].AIManager = actions;
            }
        }