public void Start() { //Game and all settings will be loaded here GameScreenSize(); GameImages.TeamTitle(); Clear(); GameImages.TitlePage(); GameImages.MainMenu(); bool mainMenu = true; while (mainMenu) { SetCursorPosition(113, 34); mainMenu = Menus.MainMenu(GameImages); // verified success aug 1 goes to USerMenus } }
public void HandlePlayerInput() //handles key input { //tutorial presented by Michael Hadley on youtube: ITP SP20: Creating an Explorable Maze in a C# Console Game ConsoleKey key; // get only the most recent key press do { ConsoleKeyInfo keyInfo = ReadKey(true); key = keyInfo.Key; } while (KeyAvailable);// loop that ensures proper keys are pressed. switch (key) { case ConsoleKey.F1: Clear(); CurrentImages.TitlePage(); CurrentImages.MainMenu(); bool mainMenu = true; while (mainMenu) { SetCursorPosition(113, 34); mainMenu = CurrentMenu.MainMenu(CurrentImages); } break; case ConsoleKey.UpArrow: if (CurrentLayout.IsPositionWalkable(CurrentPlayer.X, CurrentPlayer.Y - 1)) { //states, if the world is position walkable above the player, then they can walk. CurrentPlayer.Y -= 1; } break; case ConsoleKey.DownArrow: if (CurrentLayout.IsPositionWalkable(CurrentPlayer.X, CurrentPlayer.Y + 1)) { //states, if the world is position walkable below the player, then they can walk. CurrentPlayer.Y += 1; } break; case ConsoleKey.LeftArrow: if (CurrentLayout.IsPositionWalkable(CurrentPlayer.X - 1, CurrentPlayer.Y)) { //states, if the world is position walkable right of the player, then they can walk. CurrentPlayer.X -= 1; } break; case ConsoleKey.RightArrow: if (CurrentLayout.IsPositionWalkable(CurrentPlayer.X + 1, CurrentPlayer.Y)) { //states, if the world is position walkable left of the player, then they can walk. CurrentPlayer.X += 1; } break; default: break; } }