コード例 #1
0
        /// <summary>
        /// Draws the background for the current state of the game
        /// </summary>

        public static void DrawBackground()
        {
            switch (GameController.CurrentState)
            {
            case GameState.ViewingMainMenu:
            case GameState.ViewingGameMenu:
            case GameState.AlteringSettings:
            case GameState.ViewingHighScores:
                SwinGame.DrawBitmap(GameResources.GameImage("Menu"), 0, 0);
                SwinGame.DrawText("Difficulty: " + GameController.getAiDifficultyText(), Color.Yellow, 600, 30);
                break;

            case GameState.Discovering:
            case GameState.EndingGame:
                SwinGame.DrawBitmap(GameResources.GameImage("Discovery"), 0, 0);
                break;

            case GameState.Deploying:
                SwinGame.DrawBitmap(GameResources.GameImage("Deploy"), 0, 0);
                break;

            default:
                SwinGame.ClearScreen();
                break;
            }

            SwinGame.DrawFramerate(675, 585, GameResources.GameFont("CourierSmall"));
        }