Пример #1
0
        static void Main(string[] args)
        {
            Console.SetBufferSize(80, 25);

            // отрисовка рамки
            HLine upLine    = new HLine(0, 78, 0, '+');
            HLine downLine  = new HLine(0, 78, 24, '+');
            VLine leftLine  = new VLine(0, 24, 0, '+');
            VLine rightLine = new VLine(0, 24, 78, '+');



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



            // отрисовка точек
            Point p     = new Point(4, 5, '*');
            Snake snake = new Snake(p, 4, Direction.RIGHT);

            snake.Draw();



            Console.ReadKey();
        }
Пример #2
0
        public Wall(int mapWidth, int mapHeidht)
        {
            wallList = new List <Figure>();

            HLine upline    = new HLine(0, mapWidth - 1, 0, '+');
            HLine downline  = new HLine(0, mapWidth - 1, mapHeidht - 1, '+');
            VLine leftline  = new VLine(0, mapHeidht - 1, 0, '+');
            VLine rightline = new VLine(0, mapHeidht - 1, mapWidth - 1, '+');

            wallList.Add(upline);
            wallList.Add(downline);
            wallList.Add(leftline);
            wallList.Add(rightline);
        }
Пример #3
0
        public Walls(int mapWidth, int mapHeight)
        {
            wallList = new List <Figure>();

            //отрисовка рамочки
            HLine upLine    = new HLine(0, mapWidth - 2, 0, '+');
            HLine downLine  = new HLine(0, mapWidth - 2, mapHeight - 1, '+');
            VLine leftLine  = new VLine(0, mapHeight - 1, 0, '+');
            VLine rightLine = new VLine(0, mapHeight - 1, mapWidth - 2, '+');

            wallList.Add(upLine);
            wallList.Add(downLine);
            wallList.Add(leftLine);
            wallList.Add(rightLine);
        }