Bubble shooter: disconnected bubbles fall down

0 favourites
  • 7 posts
From the Asset Store
2D Cartoon bubble shapes icons and bubble pop animation
  • Hello fellas,

    May be there are some effective algorithms how to achieve this mechanics in bubble shooter:

    • bubbles or bubble groups, which don't connect to neighbors fall down

    Right now I'm using a recursive function which goes through all the bubbles in the hex-grid and checks with a flood-fill if bubbles connect to the upper border. It works, but the problem is, that this calculation is very resource intensive and there is a lag each time this calculation takes place. So it is called for each bubble recursively.

    Do you have any ideas how to do it in a different way?

  • im looking this too

  • I made a bubble shooter capx a while ago. It also found connected bubbles with a flood fill algorithm. It only did it when a bubble landed as there is no reason to do it continuously. I also thought the lag to not be a problem because of when it occurs.

    Some ideas to make it faster:

    1. Lookup the capx I made and see if my implementation of flood fill is more efficient than yours.

    2. You could limit the amount of lag by doing the flood fill over multiple frames.

    3. As a last resort you could come up with some type of data structure to make the flood fill more efficient by making the picking of a bubble's neighbors a simple lookup instead of a collision check against all the other bubbles. In theory it will be much faster, but it will require a lot of events and be very tedious to setup.

  • Distributing a heavy recursion/loop over multiple ticks is a clever technique, indeed.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hi xoros,

    i'm working at a Buble Shooter like game, until now i've managed the mechanics for picking/distroing connected bubbles, but now i need to destroy the groups of bubbles which are not connected with any bubbles. As i see in your first post, have you found a solution for this issue?

  • Hi,

    I've this problem too for bubble shoot, anyone can help?

  • Guys, this post will be helpful for you. There's a very good capx. example by R0J0hound:

    scirra.com/forum/bubble-shooter-ball-colisions-placement_topic62091.html

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)