public static void StartGameMenu() { Console.Clear(); Character player = new Character(); //Create directory path for files string directory = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); //Declare and initialize variables bool startGameMenuLoop = false; bool playerPassVerification = false; string input = ""; //Create keyboard object for user input ConsoleKeyInfo keyboard = new ConsoleKeyInfo(); //MainGameStart.StartZombieHunterGame(ref player); do { //Display main menu to user DisplayDocuments.DisplayStartGameMenu(); //Get keyboard input from user keyboard = Console.ReadKey(); //Controls flow of main menu switch (keyboard.Key) { case ConsoleKey.D1: case ConsoleKey.NumPad1: CharacterCreation.CreateZombieHunterPlayer(ref player); PlayerData.AddPlayerDataToDocument(ref player); break; case ConsoleKey.D2: case ConsoleKey.NumPad2: PlayerLogin.VerifyPlayerUserNamePassword(ref player, ref playerPassVerification); if (playerPassVerification == true) { Console.Clear(); MainGameStart.StartZombieHunterGame(ref player); } else { Console.WriteLine("Character not verified!"); Console.ReadLine(); } break; case ConsoleKey.Escape: //Ends program startGameMenuLoop = true; break; default: //Displays invalid option Console.WriteLine(GameLibrary.StandardMessages.DisplayInvalidOption()); break; } //Clears current screen Console.Clear(); } while (startGameMenuLoop == false); Console.ForegroundColor = ConsoleColor.White; }
static void Main(string[] args) { //Create directory path for files string directory = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); //Declare and initialize variables bool mainMenuLoop = false; string documentName = ""; int numbers = 0; string input = ""; //Create keyboard object for user input ConsoleKeyInfo keyboard; do { //Display main menu to user DisplayDocuments.DisplayMainMenu(); //Get keyboard input from user keyboard = Console.ReadKey(); //Controls flow of main menu switch (keyboard.Key) { case ConsoleKey.D1: case ConsoleKey.NumPad1: DisplayDocuments.DisplayStartGameMenu(); StartGame.StartZombieHunterGame(); break; case ConsoleKey.D2: case ConsoleKey.NumPad2: break; case ConsoleKey.D3: case ConsoleKey.NumPad3: break; case ConsoleKey.Escape: //Ends program mainMenuLoop = true; break; default: //Displays invalid option Console.WriteLine(GameLibrary.StandardMessages.DisplayInvalidOption()); break; } //Clears current screen Console.Clear(); } while (mainMenuLoop == false); }
public static void StartZombieHunterGame() { Console.Clear(); Character player = new Character(); //Create directory path for files string directory = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); //Declare and initialize variables bool startGameMenuLoop = false; string input = ""; //Create keyboard object for user input ConsoleKeyInfo keyboard = new ConsoleKeyInfo(); do { //Display main menu to user DisplayDocuments.DisplayStartGameMenu(); //Get keyboard input from user keyboard = Console.ReadKey(); //Controls flow of main menu switch (keyboard.Key) { case ConsoleKey.D1: case ConsoleKey.NumPad1: CharacterCreation.CreateZombieHunterPlayer(player); break; case ConsoleKey.D2: case ConsoleKey.NumPad2: //TODO Create player two game path break; case ConsoleKey.Escape: //Ends program startGameMenuLoop = true; break; default: //Displays invalid option Console.WriteLine(GameLibrary.StandardMessages.DisplayInvalidOption()); break; } //Clears current screen Console.Clear(); } while (startGameMenuLoop == false); }
static void Main(string[] args) { //TESTING BLOCK Console.WriteLine("TESTING MODE***\n\nGame is in testing mode. You do not have to create a character." + "\nStart game and press enter three times to skip player login. \n\nPress Enter to continue..."); Console.ReadLine(); //-------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------- //Create directory path for files string directory = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); //Declare and initialize variables bool mainMenuLoop = false; string documentName = ""; int numbers = 0; string input = ""; //Create keyboard object for user input ConsoleKeyInfo keyboard; do { //Display main menu to user DisplayDocuments.DisplayMainMenu(); //Get keyboard input from user keyboard = Console.ReadKey(); //Controls flow of main menu Console.ForegroundColor = ConsoleColor.White; switch (keyboard.Key) { case ConsoleKey.D1: case ConsoleKey.NumPad1: DisplayDocuments.DisplayStartGameMenu(); StartGame.StartGameMenu(); break; case ConsoleKey.D2: case ConsoleKey.NumPad2: OptionsMenu.MenuOptionSelection(); break; case ConsoleKey.D3: case ConsoleKey.NumPad3: break; case ConsoleKey.Escape: //Ends program mainMenuLoop = true; break; default: //Displays invalid option Console.WriteLine(GameLibrary.StandardMessages.DisplayInvalidOption()); break; } //Clears current screen Console.Clear(); } while (mainMenuLoop == false); }