Пример #1
0
 public WallManager(Texture2D wallTexture)
 {
     this.wallTexture = wallTexture;
     blocks = new WallBlock[startingNumberOfBlocks];
     for (int i = 0; i < blocks.Length; i++)
     {
         blocks[i] = new WallBlock(wallTexture, createPositionVector(i));
         wallHeight += 1;
     }
 }
Пример #2
0
 public void removeBlock()
 {
     if (blocks.Length > 0)
     {
         WallBlock[] temp = new WallBlock[blocks.Length - 1];
         for (int i = 0; i < temp.Length; i++)
         {
             temp[i] = blocks[i];
         }
         wallHeight -= 1;
         blocks = temp;
     }
 }
Пример #3
0
 public bool addBlock()
 {
     if (blocks.Length <= 9)
     {
         WallBlock[] temp = new WallBlock[blocks.Length + 1];
         for (int i = 0; i < blocks.Length; i++)
         {
             temp[i] = blocks[i];
         }
         temp[blocks.Length] = new WallBlock(wallTexture, createPositionVector(blocks.Length));
         wallHeight += 1;
         blocks = temp;
         return true;
     }
     return false;
 }
Пример #4
0
 public void Reset()
 {
     blocks = new WallBlock[startingNumberOfBlocks];
     for (int i = 0; i < blocks.Length; i++)
     {
         blocks[i] = new WallBlock(wallTexture, createPositionVector(i));
         wallHeight += 1;
     }
 }