public static void Update() { // If the player presses the start button in practice mode, it returns to the menu screen. if (StartBtn.CheckButton()) { if (Globals.Practice) { Globals.Fade.Start(Globals.MENU, 1); } else { // If the player's health is now at 0, the game ends and they are sent to the results screen. Otherwise, the next game starts. if (Globals.Health == 0) { Globals.Fade.Start(Globals.RESULTS, 1); } else { MinigameSelection.NextGame(); } } } }
public static void Update() { switch (Screen) { case START: { // Checks each of the buttons on the start screen if (StartBtn.CheckButton()) { Screen = DIFFICULTY; } else if (PracticeBtn.CheckButton()) { Screen = PRACTICE; Globals.Difficulty = Globals.MEDIUM; } else if (LeaderboardBtn.CheckButton()) { Globals.Gamestate = Globals.LEADERBOARD; } else if (HelpBtn.CheckButton()) { Screen = HELP; } break; } case PRACTICE: { // Checks the button for each of the practice games. If it is clicked, it starts the game. for (int i = 0; i < PracticeGames.Count; i++) { if (PracticeGames[i].CheckButton()) { MinigameSelection.StartPractice(i); Globals.Fade.Start(Globals.GAMEPLAY, 1); break; } } // Difficulty changing buttons if (IncDifficultyBtn.CheckButton() && Globals.Difficulty != Globals.HARD) { Globals.Difficulty++; } else if (DecDifficultyBtn.CheckButton() && Globals.Difficulty != Globals.EASY) { Globals.Difficulty--; } // Back button if (BackBtn.CheckButton()) { Screen = START; } break; } case DIFFICULTY: { // Checks each of the difficulty buttons, and starts the game with the corresponding difficulty if (EasyBtn.CheckButton()) { Globals.Fade.Start(Globals.GAMEPLAY, 1); MinigameSelection.NextGame(); Globals.Difficulty = Globals.EASY; MinigameSelection.Reset(); } else if (MediumBtn.CheckButton()) { Globals.Fade.Start(Globals.GAMEPLAY, 1); MinigameSelection.NextGame(); Globals.Difficulty = Globals.MEDIUM; MinigameSelection.Reset(); } else if (HardBtn.CheckButton()) { Globals.Fade.Start(Globals.GAMEPLAY, 1); MinigameSelection.NextGame(); Globals.Difficulty = Globals.HARD; MinigameSelection.Reset(); } else if (BackBtn.CheckButton()) { Screen = START; } break; } case HELP: { // Back button if (BackBtn.CheckButton()) { Screen = START; } break; } } }