/// <summary> /// Displays Credits text and waits for user input /// before returning to the startup menu /// </summary> public void Credits() { // Creates a new InfoRules infoRules = new InfoRules(); // Displays on-screen text infoRules.Credits(); // Displays on-screen text Console.WriteLine("Press any key to return to the main menu..."); // Waits for user input Console.ReadKey(); // // Returns to StartupMenu StartupMenu(); }
/// <summary> /// Manages the startup menu and waits for user input /// Calls for respective method based on user input /// </summary> public void StartupMenu() { // Creates a new InfoRules infoRules = new InfoRules(); // Displays on-screen text infoRules.WelcomeText(); // Stores player choice int menuChoice; // Asks for input until a valid one is given while (!int.TryParse(Console.ReadLine(), out menuChoice) || menuChoice < 1 || menuChoice > 5) { ; } // Selects section based on user input "menuChoice" switch (menuChoice) { // Executes if menuChoice is 1 case 1: // Starts a new game NewGame(); // Exits the current switch section break; // Executes if menuChoice is 2 case 2: // Displays top scores of the current board Highscores(); // Exits the current switch section break; // Executes if menuChoice is 3 case 3: // Displays on-screen text Instructions(); // Exits the current switch section break; // Executes if menuChoice is 4 case 4: // Displays on screen-text Credits(); // Exits the current switch section break; // Executes if menuChoice is 5 case 5: // Quits game QuitGame(); // Exits the current switch section break; // Executes if an invalid menuChoice is given default: // Exits the current switch section break; } }