Ejemplo n.º 1
0
        public override Screen Copy()
        {
            ShipUpgradeScreen retn = new ShipUpgradeScreen(this.game, false);
            retn.flashEndTime = this.flashEndTime;
            retn.flashPercent = this.flashPercent;
            retn.flashTime = this.flashTime;

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

            this.playerCashCount.CopyTo(retn.playerCashCount, 0);
            retn.playingTallySound = this.playingTallySound;

            retn.ReplaceScene(this.weapons);

            return retn;
        }
Ejemplo 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;
        }