示例#1
0
 void HideAllUIScreens()
 {
     completionScreen.Hide();
     map.Hide();
     pauseScreen.Hide();
     optionsScreen.Hide();
 }
示例#2
0
 public void ShowOptions()
 {
     mainMenuScreen.Hide();
     pauseScreen.Hide();
     optionsScreen.Show();
 }
        private void onGameStateChanged(GameState newState)
        {
            switch (newState)
            {
            case GameState.StartUp:
                mainMenuControl.Hide();
                highscoreControl.Hide();
                creditsControl.Hide();
                pauseControl.Hide();
                victoryControl.Hide();
                gameOverControl.Hide();
                hud.Hide();

                audioPlayer.PlayEvent("audio/music/menu");
                break;

            case GameState.Menu:
                mainMenuControl.Show();
                highscoreControl.Hide();
                creditsControl.Hide();
                pauseControl.Hide();
                victoryControl.Hide();
                gameOverControl.Hide();
                hud.Hide();

                audioPlayer.PauseCategory("ingame");
                audioPlayer.UnpauseCategory("menu");
                break;

            case GameState.Highscore:
                mainMenuControl.Hide();
                highscoreControl.Show();
                creditsControl.Hide();
                pauseControl.Hide();
                victoryControl.Hide();
                gameOverControl.Hide();
                hud.Hide();

                audioPlayer.PauseCategory("ingame");
                audioPlayer.UnpauseCategory("menu");
                break;

            case GameState.Credits:
                mainMenuControl.Hide();
                highscoreControl.Hide();
                creditsControl.Show();
                pauseControl.Hide();
                victoryControl.Hide();
                gameOverControl.Hide();
                hud.Hide();

                creditsControl.Start();

                audioPlayer.PauseCategory("ingame");
                audioPlayer.UnpauseCategory("menu");
                break;

            case GameState.Loading:
                mainMenuControl.Hide();
                highscoreControl.Hide();
                creditsControl.Hide();
                pauseControl.Hide();
                victoryControl.Hide();
                gameOverControl.Hide();;
                hud.Hide();

                audioPlayer.PlayEvent("audio/music/ingame");

                OnDetach();
                break;

            case GameState.Running:
                mainMenuControl.Hide();
                highscoreControl.Hide();
                creditsControl.Hide();
                pauseControl.Hide();
                victoryControl.Hide();
                gameOverControl.Hide();
                hud.Show();

                audioPlayer.PauseCategory("menu");
                audioPlayer.UnpauseCategory("ingame");
                break;

            case GameState.Paused:
                pauseControl.Show();
                victoryControl.Hide();
                gameOverControl.Hide();
                hud.Hide();

                audioPlayer.PauseCategory("ingame");
                audioPlayer.PauseCategory("menu");
                break;

            case GameState.Victory:
                int remainingLifes = 0;
                if (playerEntity != null)                               // Happens on a draw
                {
                    remainingLifes = playerEntity[HealthBehavior.Key_Lifes];
                }
                int totalScore = 100 * remainingLifes + playerEntity[CollectsPointsBehavior.Key_PointsCollected];
                victoryControl.CurrentScore = totalScore;

                mainMenuControl.Hide();
                highscoreControl.Hide();
                creditsControl.Hide();
                pauseControl.Hide();
                victoryControl.Show();
                gameOverControl.Hide();
                hud.Hide();

                audioPlayer.StopCategory("ingame");
                audioPlayer.PlayEvent("audio/game/win");
                break;

            case GameState.GameOver:
                mainMenuControl.Hide();
                highscoreControl.Hide();
                creditsControl.Hide();
                pauseControl.Hide();
                victoryControl.Hide();
                gameOverControl.Show();
                hud.Hide();

                audioPlayer.StopCategory("ingame");
                audioPlayer.PlayEvent("audio/game/lose");
                break;

            case GameState.Quit:
                audioPlayer.StopCategory("menu");
                RenderForm.Close();
                break;
            }
        }
示例#4
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            // Load the content for the start screen, add it to the components, and hide it.
            startScreen = new StartScreen(this, spriteBatch, Content.Load<SpriteFont>("menufont"), Content.Load<Texture2D>("Menus/StartScreen"));
            Components.Add(startScreen);
            startScreen.Hide();

            // Load the content for the loading screen.
            splashScreen = new SplashScreen(this, spriteBatch, Content.Load<Texture2D>("Menus/SampleSplashScreen"));
            Components.Add(splashScreen);
            splashScreen.Hide();

            // Load the content for the action screen, where most of the gameplay will occur.
            actionScreen = new ActionScreen(this, spriteBatch);
            Components.Add(actionScreen);
            actionScreen.Hide();

            // Load the content for the pause screen.
            pauseScreen = new PauseScreen(this, spriteBatch, Content.Load<SpriteFont>("menufont"), Content.Load<Texture2D>("Menus/PauseScreen"), actionScreen);
            Components.Add(pauseScreen);
            pauseScreen.Hide();

            // Load the content for the quit screen.
            quitScreen = new QuitScreen(this, spriteBatch, Content.Load<SpriteFont>("menufont"), Content.Load<Texture2D>("Menus/QuitScreen"), actionScreen);
            Components.Add(quitScreen);
            quitScreen.Hide();

            // Load the content for the dialogue screen.
            dialogueScreen = new DialogueScreen(this, spriteBatch, Content.Load<SpriteFont>("menufont"), Content.Load<Texture2D>("Menus/DialogueScreen"), actionScreen);
            Components.Add(dialogueScreen);
            dialogueScreen.Hide();

            // When the game starts, the active screen is the start screen.
            activeScreen = startScreen;
            activeScreen.Show();
        }