Exemplo n.º 1
0
        public override Screen Copy()
        {
            SelectionScreen retn = new SelectionScreen(this.game, false);

            retn.selectedShip = new int[] { 0, 0 };
            this.selectedShip.CopyTo(retn.selectedShip, 0);
            retn.selectedSkin = new int[] { 0, 0 };
            this.selectedSkin.CopyTo(retn.selectedSkin, 0);

            retn.player1Ready = this.player1Ready;
            retn.player2Ready = this.player2Ready;

            retn.ReplaceShips(this.ships[0].Copy(), this.ships[1].Copy());

            return retn;
        }
Exemplo n.º 2
0
        internal void ChangeState(GameState NextState)
        {
            Screen currentScreen = UpdateBuff.screen;
            //Logo spash can come from ANY state since its the place you go when you restart
            if (NextState == GameState.LogoSplash)
            {
                if (currentScreen != null)
                    currentScreen.Shutdown();

                currentScreen = new TitleScreen(this);
                UpdateBuff.state = GameState.LogoSplash;
            }
            else if (UpdateBuff.state == GameState.LogoSplash && NextState == GameState.ShipSelection)
            {
                Sound.PlayCue(Sounds.MenuAdvance);

                //This is really where the game starts so setup the player information
                UpdateBuff.players = new Player[2] { new Player(), new Player() };

                //Start at level 1
                gameLevel = 1;

                currentScreen.Shutdown();
                currentScreen = new SelectionScreen(this, true);
                UpdateBuff.state = GameState.ShipSelection;
            }
            else if (UpdateBuff.state == GameState.PlayEvolved && NextState == GameState.ShipUpgrade)
            {
                currentScreen.Shutdown();
                currentScreen = new ShipUpgradeScreen(this, true);
                UpdateBuff.state = GameState.ShipUpgrade;
            }
            else if ((UpdateBuff.state == GameState.ShipSelection || GameState == GameState.ShipUpgrade) && NextState == GameState.PlayEvolved)
            {
                Sound.PlayCue(Sounds.MenuAdvance);

                currentScreen.Shutdown();
                currentScreen = new EvolvedScreen(this);
                UpdateBuff.state = GameState.PlayEvolved;
            }
            else if (UpdateBuff.state == GameState.LogoSplash && NextState == GameState.PlayRetro)
            {
                //Game starts here for retro
                UpdateBuff.players = new Player[2] { new Player(), new Player() };

                currentScreen.Shutdown();
                currentScreen = new RetroScreen(this);
                UpdateBuff.state = GameState.PlayRetro;
            }
            else if (UpdateBuff.state == GameState.PlayEvolved && NextState == GameState.Victory)
            {
                currentScreen.Shutdown();
                currentScreen = new VictoryScreen(this, false);
                UpdateBuff.state = GameState.Victory;
            }
            else
            {
                //This is a BAD thing and should never happen
                // What does this map to on XBox 360?
                //Debug.Assert(false, String.Format("Invalid State transition {0} to {1}", gameState.ToString(), NextState.ToString()));
            }

            UpdateBuff.screen = currentScreen;
        }