Пример #1
0
        /// <summary>
        /// Draw the current state to the screen
        /// </summary>
        public static void Draw()
        {
            //Draw background for each state
            Manager.DrawBackground();
            switch (CurrentState)
            {
            case GameState.GameMenu:
                MenuController.DrawGameMenu();
                break;

            case GameState.BattlePhrase:
                BattleController.LaunchBattle();
                break;

            case GameState.Tutorial:
                TutorialController.DrawTutorial();
                break;

            case GameState.GameMenuPaused:
                //Stop the music
                SwinGame.PauseMusic();
                MenuController.DrawGameMenuPause();
                break;

            case GameState.HighScore:
                HighscoreController.DrawHighscore();
                break;

            case GameState.Ending:
                EndingGameController.DrawEnding();
                break;
            }
        }
Пример #2
0
        /// <summary>
        /// Handle user input. The way that user can go to each state
        /// </summary>
        public static void UserInput()
        {
            switch (CurrentState)
            {
            case GameState.GameMenu:
                MenuController.UserInputGameMenu();
                break;

            case GameState.BattlePhrase:
                BattleController.UserInput();
                break;

            case GameState.Tutorial:
                TutorialController.UserInputTutorial();
                break;

            case GameState.GameMenuPaused:
                MenuController.UserInputGameMenuPause();
                break;

            case GameState.HighScore:
                HighscoreController.UserInputHighscore();
                break;

            case GameState.Ending:
                EndingGameController.UserInputEnding();
                break;
            }
        }
Пример #3
0
 /// <summary>
 /// Handle user input
 /// </summary>
 public static void UserInputEnding()
 {
     if (SwinGame.KeyTyped(KeyCode.SpaceKey) || SwinGame.KeyTyped(KeyCode.EscapeKey) || SwinGame.MouseClicked(MouseButton.LeftButton))
     {
         //Go to manage score in HighController class
         HighscoreController.ManageScore(BattleController.Score);
         //Reset the game for preparing the new game
         BattleController.ResetGame();
         //End this state
         GameController.EndCurrentState();
         //Go back to background music
         SwinGame.PlayMusic("BackgroundMusic");
     }
 }