コード例 #1
0
ファイル: Program.cs プロジェクト: Maksim54/SnakeGame
        static void Main(string[] args)
        {
            Console.SetWindowSize(80, 25);
            //Отрисовка рамочки
            HorizontalLine upLine    = new HorizontalLine(0, 78, 0, '-');
            HorizontalLine downLine  = new HorizontalLine(0, 78, 24, '-');
            VerticalLine   leftLine  = new VerticalLine(0, 24, 0, 'I');
            VerticalLine   rightLine = new VerticalLine(0, 24, 78, 'I');

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

            //Отрисoвка точек
            Point p = new Point(4, 5, '*');

            p.Draw();
            Snake snake = new Snake(p, 4, Direction.RIGHT);


            /*Point p1 = new Point(1, 3, '*');
             * p1.Draw();
             *
             * Point p2 = new Point(4, 5, '#');
             *
             * p2.Draw();
             *
             * HorizontalLine line = new HorizontalLine(5,10,8,'+');
             * line.Drow();
             *
             * Console.ReadLine();*/
        }
コード例 #2
0
ファイル: Walls.cs プロジェクト: Kamba1a/BasicsOOP
        public Walls(int windowWidth, int windowHeight, char sym)
        {
            wallTop    = new HorizontalLine(1, windowWidth - 2, 0, sym);
            wallBottom = new HorizontalLine(1, windowWidth - 2, windowHeight - 1, sym);
            wallLeft   = new VerticalLine(1, windowHeight - 2, 0, sym);
            wallRight  = new VerticalLine(1, windowHeight - 2, windowWidth - 1, sym);

            ListAdd();

            Draw();
        }
コード例 #3
0
ファイル: Walls.cs プロジェクト: Kamba1a/BasicsOOP
        public Walls(int windowWidth, int windowHeight, char sym, ConsoleColor color)
        {
            wallTop    = new HorizontalLine(1, windowWidth - 2, 0, sym);
            wallBottom = new HorizontalLine(1, windowWidth - 2, windowHeight - 1, sym);
            wallLeft   = new VerticalLine(1, windowHeight - 2, 0, sym);
            wallRight  = new VerticalLine(1, windowHeight - 2, windowWidth - 1, sym);

            ListAdd();

            Console.ForegroundColor = color;
            Draw();
            Console.ResetColor();
        }
コード例 #4
0
        public Walls(int mapWidth, int mapHeight)
        {
            wallList = new List <Figure>();

            HorizontLine HighLine  = new HorizontLine(1, mapWidth - 1, 1, '+');
            HorizontLine DownLine  = new HorizontLine(1, mapWidth - 1, mapHeight - 1, '+');
            VerticalLine LeftLine  = new VerticalLine(1, mapHeight - 1, 1, '+');
            VerticalLine RightLine = new VerticalLine(1, mapHeight - 1, mapWidth - 1, '+');

            wallList.Add(HighLine);
            wallList.Add(DownLine);
            wallList.Add(LeftLine);
            wallList.Add(RightLine);
        }
コード例 #5
0
ファイル: Walls.cs プロジェクト: Jem03rus/SnakeGame
        public Walls(int mapWidth, int mapHeight)
        {
            wallList = new List <Figure>();

            // Отрисовка рамочки
            HorizontalLine upLine    = new HorizontalLine(0, mapWidth - 2, 0, '+');
            HorizontalLine downLine  = 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(upLine);
            wallList.Add(downLine);
            wallList.Add(leftLine);
            wallList.Add(rightLine);
        }
コード例 #6
0
        public Field(int height, int width)
        {
            Console.SetWindowSize(width, height);


            HorizontalLine top    = new HorizontalLine(0, width - 1, 0, '-');
            HorizontalLine bottom = new HorizontalLine(0, width - 1, height - 1, '-');
            VerticalLine   left   = new VerticalLine(1, height - 1, 0, '|');
            VerticalLine   right  = new VerticalLine(1, height - 1, width - 1, '|');

            left.Render();
            right.Render();
            top.Render();
            bottom.Render();
        }
コード例 #7
0
        public Walls(int mapWidth, int mapHeight)
        {
            wallList = new List <Figure>();
            HorizontalLine top    = new HorizontalLine(0, 80, 0, '#');
            VerticalLine   left   = new VerticalLine(0, 25, 0, '#');
            HorizontalLine bottom = new HorizontalLine(0, 80, 25, '#');
            VerticalLine   right  = new VerticalLine(0, 25, 80, '#');

            VerticalLine obstacle = new VerticalLine(10, 13, 50, '%');

            wallList.Add(top);
            wallList.Add(left);
            wallList.Add(bottom);
            wallList.Add(right);
        }
コード例 #8
0
        public walls(int upLeftX, int upLeftY, int downRightX, int downRightY, char symbol)
        {
            this.wallList = new List <Figure>();

            HorizontalLine upLine = new HorizontalLine(upLeftX, downRightX, upLeftY, symbol);

            wallList.Add(upLine);
            HorizontalLine downLine = new HorizontalLine(upLeftX, downRightX, downRightY, symbol);

            wallList.Add(downLine);
            VerticalLine leftLine = new VerticalLine(upLeftY, downRightY, upLeftX, symbol);

            wallList.Add(leftLine);
            VerticalLine rightLine = new VerticalLine(upLeftY, downRightY, downRightX, symbol);

            wallList.Add(rightLine);
        }
コード例 #9
0
ファイル: Walls.cs プロジェクト: Goldenws/SnakeGamePatched
        public Walls(int mapWidth, int mapHeight)
        {
            wallList = new List <Figure>();
            HorizontalLine top    = new HorizontalLine(0, 119, 0, '#');
            VerticalLine   left   = new VerticalLine(0, 29, 0, '#');
            HorizontalLine bottom = new HorizontalLine(0, 119, 29, '#');
            VerticalLine   right  = new VerticalLine(0, 29, 119, '#');

            VerticalLine   obstacle  = new VerticalLine(10, 13, 50, 'W');
            HorizontalLine obstacle2 = new HorizontalLine(2, 12, 21, 'W');

            wallList.Add(top);
            wallList.Add(left);
            wallList.Add(bottom);
            wallList.Add(right);
            wallList.Add(obstacle);
            wallList.Add(obstacle2);
        }