示例#1
0
        public void playGame()
        {
            timer.Elapsed += new ElapsedEventHandler(OnTimedEvent);
            timer.Enabled  = true;


            board.drawBoard();
            Console.CursorVisible = false;



            ConsoleKey action = ConsoleKey.UpArrow;

            // snake.draw();


            while (action == ConsoleKey.UpArrow || action == ConsoleKey.DownArrow || action == ConsoleKey.LeftArrow || action == ConsoleKey.RightArrow)
            {
                action = Console.ReadKey().Key;
                snake.changeDirection(action);
            }
        }