예제 #1
0
        static void Main(string[] args)
        {
            Console.SetBufferSize(80, 25);

            HorizontLine upLine    = new HorizontLine(0, 78, 0, '=');
            HorizontLine downLine  = new HorizontLine(0, 78, 24, '=');
            VerticalLine leftLine  = new VerticalLine(1, 23, 0, '|');
            VerticalLine rightLine = new VerticalLine(1, 23, 78, '|');

            upLine.Drow();
            downLine.Drow();
            leftLine.Drow();
            rightLine.Drow();

            Point p     = new Point(5, 5, '*');
            Snake snake = new Snake(p, 5, Direction.RIGHT);

            snake.Drow();

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

                snake.Move();
                snake.Drow();

                Thread.Sleep(100);
            }

            Console.ReadLine();
        }
예제 #2
0
        static void Main(string[] args)
        {
            Console.SetWindowSize(1, 1);
            Console.SetBufferSize(80, 25);
            Console.SetWindowSize(80, 25);

            //Рамочка
            HorizontLine upLine     = new HorizontLine(0, 78, 0, '+');
            HorizontLine downLine   = new HorizontLine(0, 78, 24, '+');
            VertLine     leftLine   = new VertLine(0, 24, 0, '+');
            VertLine     righttLine = new VertLine(0, 24, 78, '+');

            upLine.Drow();
            downLine.Drow();
            leftLine.Drow();
            righttLine.Drow();


            Point p = new Point(4, 5, '*');

            p.Draw();
        }