Esempio n. 1
0
        /// <summary>
        /// Draws the current state of the game to the screen.
        /// </summary>
        /// <remarks>
        /// What is drawn depends upon the state of the game.
        /// </remarks>
        public static void DrawScreen()
        {
            UtilityFunctions.DrawBackground();

            switch (CurrentState)
            {
            case GameState.ViewingMainMenu:
            {
                MenuController.DrawMainMenu();
                break;
            }

            case GameState.ViewingGameMenu:
            {
                MenuController.DrawGameMenu();
                break;
            }

            case GameState.AlteringSettings:
            {
                MenuController.DrawSettings();
                break;
            }

            case GameState.Deploying:
            {
                DeploymentController.DrawDeployment();
                break;
            }

            case GameState.Discovering:
            {
                DiscoveryController.DrawDiscovery();
                break;
            }

            case GameState.EndingGame:
            {
                EndingGameController.DrawEndOfGame();
                break;
            }

            case GameState.ViewingHighScores:
            {
                HighScoreController.DrawHighScores();
                break;
            }
            }

            UtilityFunctions.DrawAnimations();

            SwinGame.RefreshScreen();
        }
Esempio n. 2
0
        /// <summary>
        /// Draws the current state of the game to the screen.
        /// <remarks>
        /// What is drawn depends upon the state of the game.
        /// </remarks>
        /// </summary>
        public static void DrawScreen()
        {
            UtilityFunctions.DrawBackground();

            switch (CurrentState)
            {
            case GameState.ViewingMainMenu:
            {
                MenuController.DrawMainMenu();
                break;
            }

            case GameState.ViewingGameMenu:
            {
                MenuController.DrawGameMenu();
                break;
            }

            case GameState.AlteringSettings:
            {
                MenuController.DrawSettings();
                break;
            }

            case GameState.Rules:
            {
                MenuController.drawRules();
                break;
            }

            case GameState.Controls:
            {
                MenuController.drawControls();
                break;
            }

            case GameState.AlteringVolume:
            {
                if (_state.Skip(1).First() == GameState.ViewingGameMenu)
                {
                    MenuController.DrawVolumeSettings(1);
                }
                else if (_state.Skip(1).First() == GameState.ViewingMainMenu)
                {
                    MenuController.DrawVolumeSettings(0);
                }
                break;
            }

            case GameState.Deploying:
            {
                DeploymentController.DrawDeployment();
                break;
            }

            case GameState.Discovering:
            {
                DiscoveryController.DrawDiscovery();
                break;
            }

            case GameState.EndingGame:
            {
                EndingGameController.DrawEndOfGame();
                break;
            }

            case GameState.ViewingHighScores:
            {
                HighScoreController.DrawHighScores();
                break;
            }
            }

            UtilityFunctions.DrawAnimations();

            SwinGame.RefreshScreen(60);
        }