private static void ReadPlayersInputKey(bool areTwoPlayersSelected) { if (Console.KeyAvailable) { ConsoleKeyInfo movementDirectionKey = Console.ReadKey(true); Console.CursorVisible = false; if (GameKeyAuthenticator.IsArrowKey(movementDirectionKey)) { var newDirection = DirectionManager.GetNextDirection(movementDirectionKey); var elementToDelete = new Point(0, 0); if (areTwoPlayersSelected) { if (movementDirectionKey.Key == ConsoleKey.W || movementDirectionKey.Key == ConsoleKey.S) { elementToDelete = UpdateLeftRocket(true, newDirection); } else { elementToDelete = UpdateLeftRocket(false, newDirection); } } else if (!areTwoPlayersSelected) { elementToDelete = UpdateLeftRocket(true, newDirection); } } } }
public static ConsoleKeyInfo ChooseDifficulty() { while (true) { List <Point> playerRocket = new List <Point>(); ConsolePrinter.StartScreen(); ConsoleKeyInfo difficultyLevelKey = Console.ReadKey(true); if (!GameKeyAuthenticator.IsDifficultyLevelKey(difficultyLevelKey)) { Console.Clear(); continue; } return(difficultyLevelKey); } }