Ejemplo n.º 1
0
        /// <summary>
        /// The setup menu was clicked, perform the button's action.
        /// </summary>
        /// <param name="button">the button pressed</param>
        private static void PerformSetupMenuAction(int button)
        {
            switch (button)
            {
            //Easy difficulty button deleted. No AI for Easy. Reimplement if Easy Code is made.
//            case SETUP_MENU_EASY_BUTTON:
//                GameController.SetDifficulty(AIOption.Easy);
//                break;
            case SETUP_MENU_MEDIUM_BUTTON:
                GameController.SetDifficulty(AIOption.Medium);
                break;

            case SETUP_MENU_HARD_BUTTON:
                GameController.SetDifficulty(AIOption.Hard);
                break;
            }
            //Always end state - handles exit button as well
            GameController.EndCurrentState();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// The setup menu was clicked, perform the button's action.
        /// </summary>
        /// <param name="button">the button pressed</param>
        private static void PerformSetupMenuAction(int button)
        {
            switch (button)
            {
            case SETUP_MENU_EASY_BUTTON:
                GameController.SetDifficulty(AIOption.Hard);
                break;

            case SETUP_MENU_MEDIUM_BUTTON:
                GameController.SetDifficulty(AIOption.Hard);
                break;

            case SETUP_MENU_HARD_BUTTON:
                GameController.SetDifficulty(AIOption.Hard);
                break;
            }
            //Always end state - handles exit button as well
            GameController.EndCurrentState();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// The color menu was clicked, perform the button's action.
        /// </summary>
        /// <param name="button">the button pressed</param>
        private static void PerformColorMenuAction(int button)
        {
            switch (button)
            {
            case COLOR_MENU_BLUE_BUTTON:
                MENU_COLOR = COLOR_BLUE;
                break;

            case COLOR_MENU_YELLOW_BUTTON:
                MENU_COLOR = COLOR_YELLOW;
                break;

            case COLOR_MENU_GREEN_BUTTON:
                MENU_COLOR = COLOR_GREEN;
                break;
            }
            //Always end state - handles exit button as well
            GameController.EndCurrentState();
        }
Ejemplo n.º 4
0
        /// <summary>
        /// The game menu was clicked, perform the button's action.
        /// </summary>
        /// <param name="button">the button pressed</param>
        private static void PerformGameMenuAction(int button)
        {
            switch (button)
            {
            case GAME_MENU_RETURN_BUTTON:
                GameController.EndCurrentState();
                break;

            case GAME_MENU_SURRENDER_BUTTON:
                GameController.EndCurrentState();
                //end game menu
                GameController.EndCurrentState();
                //end game
                break;

            case GAME_MENU_QUIT_BUTTON:
                GameController.AddNewState(GameState.Quitting);
                break;
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// The main menu was clicked, perform the button's action.
        /// </summary>
        /// <param name="button">the button pressed</param>
        private static void PerformMainMenuAction(int button)
        {
            switch (button)
            {
            case MAIN_MENU_PLAY_BUTTON:
                GameController.StartGame();
                break;

            case MAIN_MENU_SETUP_BUTTON:
                GameController.AddNewState(GameState.AlteringSettings);
                break;

            case MAIN_MENU_TOP_SCORES_BUTTON:
                GameController.AddNewState(GameState.ViewingHighScores);
                break;

            case MAIN_MENU_QUIT_BUTTON:
                GameController.EndCurrentState();
                break;
            }
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Handles the user input during the top score screen.
 /// </summary>
 /// <remarks></remarks>
 public static void HandleHighScoreInput()
 {
     if (SwinGame.MouseClicked(MouseButton.LeftButton) || SwinGame.KeyTyped(KeyCode.EscapeKey) || SwinGame.KeyTyped(KeyCode.ReturnKey))
         GameController.EndCurrentState();
 }