Пример #1
0
        public Walls(int _mapWidth, int _mapHeight)
        {
            wallList = new List <Figure>();
            HorizontalLine topLine    = new HorizontalLine(0, _mapWidth - 2, 0, '+');
            HorizontalLine bottomLine = new HorizontalLine(0, _mapWidth - 2, _mapHeight - 2, '+');
            VerticalLine   leftLine   = new VerticalLine(0, _mapHeight - 2, 0, '+');
            VerticalLine   rightLine  = new VerticalLine(0, _mapHeight - 2, _mapWidth - 2, '+');

            wallList.Add(topLine);
            wallList.Add(bottomLine);
            wallList.Add(leftLine);
            wallList.Add(rightLine);

            obstacleList = new List <Figure>();
            HorizontalLine levelOneObstacle1 = new HorizontalLine(63, 73, 20, '+');
            HorizontalLine levelOneObstacle2 = new HorizontalLine(20, 30, 10, '+');
            VerticalLine   levelOneObstacle3 = new VerticalLine(10, 20, 40, '+');
            VerticalLine   levelOneObstacle4 = new VerticalLine(5, 15, 60, '+');

            obstacleList.Add(levelOneObstacle1);
            obstacleList.Add(levelOneObstacle2);
            obstacleList.Add(levelOneObstacle3);
            obstacleList.Add(levelOneObstacle4);
            GenerateObstacles();
        }
Пример #2
0
        public Bridge()
        {
            bridgeList = new List <Figure>();
            VerticalLine bridgeEast = new VerticalLine(1, 4, 77, '*');
            VerticalLine bridgeWest = new VerticalLine(19, 22, 1, '*');

            bridgeList.Add(bridgeEast);
            bridgeList.Add(bridgeWest);
        }
Пример #3
0
        public Walls(int mapWidth, int mapHeight)
        {
            wallList = new List <Figure>();
            HorizontalLine topLine    = new HorizontalLine(0, mapWidth - 2, 0, '#');
            HorizontalLine bottomLine = new HorizontalLine(0, mapWidth - 2, mapHeight - 1, '#');
            VerticalLine   leftLine   = new VerticalLine(0, mapHeight - 1, 0, '#');
            VerticalLine   rightLine  = new VerticalLine(0, mapHeight - 1, mapWidth - 2, '#');

            wallList.Add(topLine);
            wallList.Add(bottomLine);
            wallList.Add(leftLine);
            wallList.Add(rightLine);
        }
Пример #4
0
        public Walls(int mapWidth, int mapHeight)
        {
            wallList = new List <Figure>();
            HorizontalLine topLine    = new HorizontalLine(0, mapWidth - 2, 0, "_");
            HorizontalLine bottomLine = new HorizontalLine(0, mapWidth - 2, mapHeight - 1, "_");
            VerticalLine   leftLine   = new VerticalLine(1, mapHeight - 1, 0, "|");
            VerticalLine   rightLine  = new VerticalLine(1, mapHeight - 1, mapWidth - 2, "|");

            wallList.Add(topLine);
            wallList.Add(bottomLine);
            wallList.Add(leftLine);
            wallList.Add(rightLine);

            //Random rndd = new Random();
        }
Пример #5
0
        public Walls(int mapWidth, int mapHeight)
        {
            wallList = new List <Figure>();
            HorizontalLines topLine            = new HorizontalLines(0, mapWidth - 2, 0, '#');
            HorizontalLines bottomLine         = new HorizontalLines(0, mapWidth - 2, mapHeight - 1, '#');
            VerticalLine    leftLine           = new VerticalLine(0, mapHeight - 1, 0, '#');
            VerticalLine    rightLine          = new VerticalLine(0, mapHeight - 1, mapWidth - 2, '#');
            VerticalLine    obstacleVertical   = new VerticalLine(2, rnd.Next(3, 23), rnd.Next(3, 23), '*');
            HorizontalLines obstacleHorizontal = new HorizontalLines(2, rnd.Next(3, 23), rnd.Next(3, 23), '*');

            wallList.Add(topLine);
            wallList.Add(bottomLine);
            wallList.Add(leftLine);
            wallList.Add(rightLine);
            wallList.Add(obstacleVertical);
            wallList.Add(obstacleHorizontal);
        }
Пример #6
0
        public Walls(int mapWidth, int mapHeight)
        {
            Random rnd = new Random();
            int    obstacleBeginningXCoordinate = rnd.Next(1, mapWidth - 4);
            int    obstacleLength      = rnd.Next(1, mapWidth - obstacleBeginningXCoordinate);
            int    obstacleYCoordinate = rnd.Next(0, mapHeight - 2);

            wallList = new List <Figure>();
            HorizontalLine topLine      = new HorizontalLine(0, mapWidth - 2, 0, '#');
            HorizontalLine bottomLine   = new HorizontalLine(0, mapWidth - 2, mapHeight - 1, '#');
            VerticalLine   leftLine     = new VerticalLine(0, mapHeight - 1, 0, '#');
            VerticalLine   rightLine    = new VerticalLine(0, mapHeight - 1, mapWidth - 2, '#');
            HorizontalLine obstacleLine = new HorizontalLine(obstacleBeginningXCoordinate, obstacleBeginningXCoordinate + obstacleLength, obstacleYCoordinate, '#');

            wallList.Add(topLine);
            wallList.Add(bottomLine);
            wallList.Add(leftLine);
            wallList.Add(rightLine);
            wallList.Add(obstacleLine);
        }
Пример #7
0
        public Walls(int mapWidth, int mapHeight)
        {
            int x     = rnd.Next(2, mapWidth - 2);
            int y     = rnd.Next(2, mapHeight - 2);
            int begin = rnd.Next(2, mapHeight - 2);

            wallList = new List <Figure>();
            HorizontalLine topLine     = new HorizontalLine(0, mapWidth - 2, 0, '#');
            HorizontalLine buttonLine  = new HorizontalLine(0, mapWidth - 2, mapHeight - 1, '#');
            VerticalLine   leftLine    = new VerticalLine(0, mapHeight - 1, 0, '#');
            VerticalLine   rightLine   = new VerticalLine(0, mapHeight - 1, mapWidth - 2, '#');
            HorizontalLine takistus    = new HorizontalLine(begin, x, y, '@');
            VerticalLine   takistusTwo = new VerticalLine(begin, x, y, '@');

            wallList.Add(topLine);
            wallList.Add(buttonLine);
            wallList.Add(leftLine);
            wallList.Add(rightLine);
            wallList.Add(takistus);
            wallList.Add(takistusTwo);
        }
Пример #8
0
        public Walls(int mapWidth, int mapHeight)
        {
            wallList = new List <Figure>();
            HorizontalLine topLine    = new HorizontalLine(0, mapWidth - 2, 0, Convert.ToChar("\u2588"));
            HorizontalLine bottomLine = new HorizontalLine(0, mapWidth - 2, mapHeight - 1, Convert.ToChar("\u2588"));
            VerticalLine   leftLine   = new VerticalLine(0, mapHeight - 1, 0, Convert.ToChar("\u2588"));
            VerticalLine   rightLine  = new VerticalLine(0, mapHeight - 1, mapWidth - 2, Convert.ToChar("\u2588"));

            Random rnd = new Random();

            HorizontalLine newLine  = new HorizontalLine(rnd.Next(5, 70), rnd.Next(5, 70), rnd.Next(0, 25), Convert.ToChar("\u2588"));
            VerticalLine   newLine2 = new VerticalLine(rnd.Next(1, 23), rnd.Next(1, 23), rnd.Next(0, 24), Convert.ToChar("\u2588"));


            wallList.Add(newLine2);
            wallList.Add(newLine);

            wallList.Add(topLine);
            wallList.Add(bottomLine);
            wallList.Add(leftLine);
            wallList.Add(rightLine);
        }
Пример #9
0
        public Walls(int mapWidth, int mapHeight)
        {
            wallList = new List <Figure>();
            HorizontalLine topLine    = new HorizontalLine(0, mapWidth - 2, 0, '*');
            HorizontalLine bottomLine = new HorizontalLine(0, mapWidth - 2, mapHeight - 1, '*');
            VerticalLine   leftLine   = new VerticalLine(0, mapHeight - 1, 0, '*');
            VerticalLine   rightLine  = new VerticalLine(0, mapHeight - 1, mapWidth - 2, '*');

            wallList.Add(topLine);
            wallList.Add(bottomLine);
            wallList.Add(leftLine);
            wallList.Add(rightLine);

            Random rnd = new Random();
            int    x   = rnd.Next(1, mapWidth - 6);
            int    y   = rnd.Next(1, mapHeight - 6);

            HorizontalLine randomLine = new HorizontalLine(x, x + 3, y, '_');

            wallList.Add(randomLine);
            VerticalLine randomVertical = new VerticalLine(y + 5, y + 5, x - 6, '|');

            wallList.Add(randomVertical);
        }