示例#1
0
        public void draw(GameSpace screen)
        {
            for (int y = 0; y < rows; y++)
            {
                for (int x = 0; x < cols; x++)
                {
                    int yPosition = (int)position.y;
                    int xPosition = (int)position.x;

                    screen.gameArr[(screen.rows - yPosition) - 1 + y, xPosition + x] = data[y, x];
                }
            }
        }
示例#2
0
 public void draw(GameSpace screen)
 {
     for (int arrY = 0; arrY < 1; arrY++)
     {
         for (int arrX = 0; arrX < 3; arrX++)
         {
             if (!isVisible)
             {
                 wallPoint = new Sprite((int)position.y, (int)position.x, new char[1, 3] {
                     { ' ', ' ', ' ' }
                 });
             }
             screen.gameArr[(int)position.y, (int)position.x + arrX] = wallPoint.data[arrY, arrX];
         }
     }
 }
示例#3
0
        public Game(int rows, int cols)
        {
            this.end  = false;
            this.rows = rows;
            this.cols = cols;

            screen     = new GameSpace(rows, cols);
            vectorBall = new Vector(startingSpeedY, startingSpeedX);

            ball = new Sprite(30, 5, new char[1, 1] {
                { '■' }
            });
            player = new Sprite((rows - 1) / 8, (cols - 1) / 2, new char[1, platformWidth] {
                { platform, platform, platform, platform, platform, platform, platform, platform, platform, platform, platform }
            });

            fillWallPoints();
            sprites = new Sprite[] { ball, player };
        }