コード例 #1
0
        static void Main(string[] args)
        {
            Console.SetWindowSize(X + 10, Y + 10);
            Console.SetBufferSize(X + 10, Y + 10);

            Console.CursorVisible = false;

            walls = new Walls(X, Y - 1, '#');

            foodFactory = new FoodFactory(X, Y, '@');
            foodFactory.CreateFood();

            snake = new Snake(X / 2, (Y - 1) / 2, 3);
            time  = new Timer(Loop, null, 0, 200);

            while (true)
            {
                if (Console.KeyAvailable)
                {
                    ConsoleKeyInfo key = Console.ReadKey();
                    snake.Rotation(key.Key);
                }
            }
        }