Exemple #1
0
 private void initWallBlocks()
 {
     for (int i = 0; i < cols; i++)
     {
         Point     tempBottom = new Point(botLeft.x + (i * Wall.size.width), botLeft.y, botLeft.z);
         Point     tempTop    = new Point(botLeft.x + (i * Wall.size.width), topRight.y, topRight.z);
         WallBlock tempWall   = new WallBlock(tempBottom, tempTop);
         wallBlocks.Add(tempWall);
     }
 }
 private void initWallBlocks()
 {
     for (int i = 0; i < cols;i++)
       {
     Point tempBottom = new Point(botLeft.x + (i*Wall.size.width), botLeft.y, botLeft.z);
     Point tempTop = new Point(botLeft.x + (i*Wall.size.width), topRight.y, topRight.z);
     WallBlock tempWall = new WallBlock(tempBottom, tempTop);
     wallBlocks.Add(tempWall);
       }
 }
        public override void Initialize()
        {
            BubbleHolder.initGrid(boardPosition.x, boardPosition.y, boardPosition.z);
              if (currentLevel == 2)
              {
            /*
            for (int j = 0; j < 4; j++)
            {
              for (int i = 0; i < 8; i++)
              {
            BubbleHolder.grid[i, j].bubble = BubbleCreator.createRandomBubble(BubbleHolder.grid[i, j].point);
            childComponents.Add(BubbleHolder.grid[i, j].bubble);
              }
            }
             * */
            createLevel2();
              }
              else
              {
            /*
            int[] coordinates = new int[]{ 0, 0 };
            BubbleHolder.grid[coordinates[0], coordinates[1]].bubble = new Bubble(Game, BubbleColor.red, BubbleHolder.grid[coordinates[0], coordinates[1]].point);
            childComponents.Add(BubbleHolder.grid[coordinates[0], coordinates[1]].bubble);

            coordinates = new int[] { 0, 1 };
            BubbleHolder.grid[coordinates[0], coordinates[1]].bubble = new Bubble(Game, BubbleColor.red, BubbleHolder.grid[coordinates[0], coordinates[1]].point);
            childComponents.Add(BubbleHolder.grid[coordinates[0], coordinates[1]].bubble);

            coordinates = new int[] { 0, 2 };
            BubbleHolder.grid[coordinates[0], coordinates[1]].bubble = new Bubble(Game, BubbleColor.red, BubbleHolder.grid[coordinates[0], coordinates[1]].point);
            childComponents.Add(BubbleHolder.grid[coordinates[0], coordinates[1]].bubble);
             * */
            createLevel1();
              }

              WallBlock w1 = new WallBlock(new Point(verteces[0], verteces[2], verteces[5]), new Point(verteces[0], verteces[3]+3, verteces[4]));
              walls.Add(w1);

              //WallBlock w2 = new WallBlock(new Point(verteces[0], verteces[2], verteces[5]), new Point(verteces[1] + 2, verteces[2], verteces[5]));
              //walls.Add(w2);

              WallBlock w3 = new WallBlock(new Point(verteces[1], verteces[2], verteces[5]), new Point(verteces[1], verteces[3] + 3, verteces[4]));
              walls.Add(w3);

              WallBlock w4 = new WallBlock(new Point(verteces[0]+2, verteces[3], verteces[4]), new Point(verteces[1] + 2, verteces[3], verteces[4]));
              walls.Add(w4);

              WallBlock w5 = new WallBlock(new Point(verteces[0], verteces[2], verteces[5] - Wall.size.depth), new Point(verteces[0], verteces[3] + 3, verteces[4] - Wall.size.depth));
              walls.Add(w5);

              //WallBlock w2 = new WallBlock(new Point(verteces[0], verteces[2], verteces[5]), new Point(verteces[1] + 2, verteces[2], verteces[5]));
              //walls.Add(w2);

              WallBlock w6 = new WallBlock(new Point(verteces[1], verteces[2], verteces[5] - Wall.size.depth), new Point(verteces[1], verteces[3] + 3, verteces[4] - Wall.size.depth));
              walls.Add(w6);

              WallBlock w7 = new WallBlock(new Point(verteces[0] + 2, verteces[3], verteces[4] - Wall.size.depth), new Point(verteces[1] + 2, verteces[3], verteces[4] - Wall.size.depth));
              walls.Add(w7);

              WallBlock w8 = new WallBlock(new Point(verteces[0], verteces[2], verteces[5] - 2 * Wall.size.depth), new Point(verteces[0], verteces[3] + 3, verteces[4] - 2 * Wall.size.depth));
              walls.Add(w8);

              //WallBlock w2 = new WallBlock(new Point(verteces[0], verteces[2], verteces[5]), new Point(verteces[1] + 2, verteces[2], verteces[5]));
              //walls.Add(w2);

              WallBlock w9 = new WallBlock(new Point(verteces[1], verteces[2], verteces[5] - 2 * Wall.size.depth), new Point(verteces[1], verteces[3] + 3, verteces[4] - 2 * Wall.size.depth));
              walls.Add(w9);

              WallBlock w10 = new WallBlock(new Point(verteces[0] + 2, verteces[3], verteces[4] - 2 * Wall.size.depth), new Point(verteces[1] + 2, verteces[3], verteces[4] - 2 * Wall.size.depth));
              walls.Add(w10);

              background = new WallArea(new Point(verteces[0]+2, verteces[2], verteces[5]-5), new Point(verteces[1], verteces[3]+4, verteces[4]-5));

              base.Initialize();
        }
Exemple #4
0
        public override void Initialize()
        {
            BubbleHolder.initGrid(boardPosition.x, boardPosition.y, boardPosition.z);
            if (currentLevel == 2)
            {
                /*
                 * for (int j = 0; j < 4; j++)
                 * {
                 * for (int i = 0; i < 8; i++)
                 * {
                 *  BubbleHolder.grid[i, j].bubble = BubbleCreator.createRandomBubble(BubbleHolder.grid[i, j].point);
                 *  childComponents.Add(BubbleHolder.grid[i, j].bubble);
                 * }
                 * }
                 * */
                createLevel2();
            }
            else
            {
                /*
                 * int[] coordinates = new int[]{ 0, 0 };
                 * BubbleHolder.grid[coordinates[0], coordinates[1]].bubble = new Bubble(Game, BubbleColor.red, BubbleHolder.grid[coordinates[0], coordinates[1]].point);
                 * childComponents.Add(BubbleHolder.grid[coordinates[0], coordinates[1]].bubble);
                 *
                 * coordinates = new int[] { 0, 1 };
                 * BubbleHolder.grid[coordinates[0], coordinates[1]].bubble = new Bubble(Game, BubbleColor.red, BubbleHolder.grid[coordinates[0], coordinates[1]].point);
                 * childComponents.Add(BubbleHolder.grid[coordinates[0], coordinates[1]].bubble);
                 *
                 * coordinates = new int[] { 0, 2 };
                 * BubbleHolder.grid[coordinates[0], coordinates[1]].bubble = new Bubble(Game, BubbleColor.red, BubbleHolder.grid[coordinates[0], coordinates[1]].point);
                 * childComponents.Add(BubbleHolder.grid[coordinates[0], coordinates[1]].bubble);
                 * */
                createLevel1();
            }

            WallBlock w1 = new WallBlock(new Point(verteces[0], verteces[2], verteces[5]), new Point(verteces[0], verteces[3] + 3, verteces[4]));

            walls.Add(w1);

            //WallBlock w2 = new WallBlock(new Point(verteces[0], verteces[2], verteces[5]), new Point(verteces[1] + 2, verteces[2], verteces[5]));
            //walls.Add(w2);

            WallBlock w3 = new WallBlock(new Point(verteces[1], verteces[2], verteces[5]), new Point(verteces[1], verteces[3] + 3, verteces[4]));

            walls.Add(w3);

            WallBlock w4 = new WallBlock(new Point(verteces[0] + 2, verteces[3], verteces[4]), new Point(verteces[1] + 2, verteces[3], verteces[4]));

            walls.Add(w4);

            WallBlock w5 = new WallBlock(new Point(verteces[0], verteces[2], verteces[5] - Wall.size.depth), new Point(verteces[0], verteces[3] + 3, verteces[4] - Wall.size.depth));

            walls.Add(w5);

            //WallBlock w2 = new WallBlock(new Point(verteces[0], verteces[2], verteces[5]), new Point(verteces[1] + 2, verteces[2], verteces[5]));
            //walls.Add(w2);

            WallBlock w6 = new WallBlock(new Point(verteces[1], verteces[2], verteces[5] - Wall.size.depth), new Point(verteces[1], verteces[3] + 3, verteces[4] - Wall.size.depth));

            walls.Add(w6);

            WallBlock w7 = new WallBlock(new Point(verteces[0] + 2, verteces[3], verteces[4] - Wall.size.depth), new Point(verteces[1] + 2, verteces[3], verteces[4] - Wall.size.depth));

            walls.Add(w7);

            WallBlock w8 = new WallBlock(new Point(verteces[0], verteces[2], verteces[5] - 2 * Wall.size.depth), new Point(verteces[0], verteces[3] + 3, verteces[4] - 2 * Wall.size.depth));

            walls.Add(w8);

            //WallBlock w2 = new WallBlock(new Point(verteces[0], verteces[2], verteces[5]), new Point(verteces[1] + 2, verteces[2], verteces[5]));
            //walls.Add(w2);

            WallBlock w9 = new WallBlock(new Point(verteces[1], verteces[2], verteces[5] - 2 * Wall.size.depth), new Point(verteces[1], verteces[3] + 3, verteces[4] - 2 * Wall.size.depth));

            walls.Add(w9);

            WallBlock w10 = new WallBlock(new Point(verteces[0] + 2, verteces[3], verteces[4] - 2 * Wall.size.depth), new Point(verteces[1] + 2, verteces[3], verteces[4] - 2 * Wall.size.depth));

            walls.Add(w10);

            background = new WallArea(new Point(verteces[0] + 2, verteces[2], verteces[5] - 5), new Point(verteces[1], verteces[3] + 4, verteces[4] - 5));


            base.Initialize();
        }