public void GameCallbackExitTest() { Game game = new Game(10, 10); Assert.IsTrue(game.ControllCallback(ConsoleKey.Escape)); Assert.IsTrue(game.ControllCallback(ConsoleKey.Enter)); }
public void GameCallbackArrowsTest() { Game game = new Game(10, 10); Assert.IsFalse(game.ControllCallback(ConsoleKey.DownArrow)); Assert.IsFalse(game.ControllCallback(ConsoleKey.UpArrow)); Assert.IsFalse(game.ControllCallback(ConsoleKey.LeftArrow)); Assert.IsFalse(game.ControllCallback(ConsoleKey.RightArrow)); }
static public void Tick(Object stateInfo) { if (_isDrawing) { return; } _isDrawing = true; if (Console.KeyAvailable) { ConsoleKeyInfo cki = Console.ReadKey(false); _exit = _game.ControllCallback(cki.Key); } Console.Clear(); _game.Tick(); _game.Render(); DrawScreen(); _isDrawing = false; }