public void OnKeyPress(ConsoleKey key) { if (key == ConsoleKey.Enter) { Done = true; return; } if (key == ConsoleKey.LeftArrow) { if (currentSnakeIndex == 0) { currentSnakeIndex = snakes.Length - 1; } else { currentSnakeIndex--; } } else if (key == ConsoleKey.RightArrow) { if (currentSnakeIndex == snakes.Length - 1) { currentSnakeIndex = 0; } else { currentSnakeIndex++; } } OutputWriter.DisplayMenu(this); }
private void Pause() { PauseMenu pauseMenu = new PauseMenu(); OutputWriter.DisplayMenu(pauseMenu); }