예제 #1
0
        private void Moving()
        {
            SnakeStateMachine snake = new SnakeStateMachine();

            Console.WriteLine(snake.DirectionNames);
            while (true)
            {
                snake.changeddirection(Console.ReadKey(true));
                Console.WriteLine(snake.DirectionNames);
            }
        }
예제 #2
0
 public void Start()
 {
     snake = new SnakeStateMachine();
     pg    = new Playground();
     Task.Run(() => { moving(); });
     while (true)
     {
         Thread.Sleep(500);
         Playgroundworker();
     }
 }