public void checkCollisions()
 {
     if (BubbleHolder.checkColliding(bubbles[0]))
     {
         bubbles[0].stop();
         BubbleHolder.snapToGrid(bubbles[0]);
         changeBubbles();
         isReady = true;
         if (numberOfShots >= 3)
         {
             BubbleHolder.MoveCeilingDown();
             numberOfShots = 0;
         }
     }
     if (BoardMain.checkWallCollision(bubbles[0]))
     {
         Velocity temp = bubbles[0].getVelocity();
         bubbles[0].setVelocity(new Velocity(-temp.x, temp.y, temp.z));
     }
     if (BoardMain.checkReachedLimit(bubbles[0]))
     {
         bubbles[0].stop();
         BubbleHolder.snapToGrid(bubbles[0]);
         //bubbles[0].popBubble();
         changeBubbles();
     }
 }
Example #2
0
 public static void finalizeDropping()
 {
     if (droppingBubbles != null)
     {
         for (int i = 0; i < droppingBubbles.Count; i++)
         {
             if (BoardMain.checkOutOfBounds(droppingBubbles[i]))
             {
                 droppingBubbles.RemoveAt(i);
             }
         }
     }
 }
Example #3
0
 public void changeLevel()
 {
     Components.Remove(main);
       Components.Remove(player);
       CurrentLevel = 2;
       sprite = Content.Load<Texture2D>("Bubbles");
       BubbleCreator.setXNA(this, sprite);
       main = new BoardMain(this, sprite, CurrentLevel);
       arrowSprite = Content.Load<Texture2D>("Arrow");
       player = new BoardPlayer(this, sprite, arrowSprite);
       BubbleHolder.score = 0;
       Components.Add(main);
       Components.Add(player);
 }
Example #4
0
 public BoardGame(Game game, int lvl)
     : base(game)
 {
     bubbleBoard = new BoardMain(game, lvl);
     playerBoard = new BoardPlayer(game);
 }
Example #5
0
 public BoardGame(Game game, int lvl)
     : base(game)
 {
     bubbleBoard = new BoardMain(game, lvl);
       playerBoard = new BoardPlayer(game);
 }
Example #6
0
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);
              Services.AddService(typeof(SpriteBatch),spriteBatch);
              sprite = Content.Load<Texture2D>("Bubbles");
              BubbleCreator.setXNA(this, sprite);
              main = new BoardMain(this, sprite, CurrentLevel);
              arrowSprite = Content.Load<Texture2D>("Arrow");
              player = new BoardPlayer(this, sprite, arrowSprite);

              wall = new Texture2D(GraphicsDevice, 1, 1, false, SurfaceFormat.Color);
              wall.SetData(new[] { Color.White });

              Components.Add(main);
              Components.Add(player);
        }