Example #1
0
        public override Screen Copy()
        {
            VictoryScreen retn = new VictoryScreen(this.game, false);
            retn.scene.Remove(this.ship);
            retn.ship = this.ship.Copy();
            retn.scene.Add(retn.ship);

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