[PUZZLE] How do I fix chain reaction in Bubble Shooter?

0 favourites
From the Asset Store
An amazing and interesting puzzle game for kids!
  • Hey Guys, I'm having a problem about chain reaction, basically I want to connect all same colour bubbles to destroy when are connected.

    This .capx actually can destroy all same colour bubbles while they aren't connected.


    You can play as you can understand how it works.

    Then Press E to activate one colour bubble to shoot and connect togheter until 3 bubbles are matched to destroy.

    There are 2 screenshot:

    After press "E", then shoot 2 bubbles in left and shoot one bubble in right, now shoot another bubble in left, it works fine as it's connected.

    The problem is if we do 2 bubbles in left and 2 bubbles in right, then shoot to left or right, it destroys all bubbles while is not connected, it's broken, I had no idea how to fix. There a group about chain reaction in .capx, forget other events because aren't related to chain reaction.

    Would you help me?


  • R0J0hound

    Sorry for bothering you, I've used your floodfill method, would you mind to help my problem?

  • Joannesalfa

    You need to reset "picked" and "visited" to false every time before doing the floodfill. Doing it in event 13 works.

  • R0J0hound Thanks, I'm testing it.

    There another question, If you don't mind, I'm figuring out how to fall the bubbles if they aren't connected to top. Do you have better ideas?

  • In the example i did before its just another floodfill. It's started by picking the top row gems, then a flood fill is done and anything that's not picked is not connected.

  • R0J0hound Sorry for late reply, I couldn't figure out, as you say to reset 2 booleans "picked" and "visited" I don't know how to put where, but, what's condition. I added False to picked and visited in event number 13 and it won't work.

    I added "X Is picked" with falling movement action, the game starts to freeze due to loop, if this condition is separated, every games started to fall for no reason.

  • I apologize I looked at it again and I misspoke, it should have been event 12.

    https://dl.dropboxusercontent.com/u/542 ... inFix.capx

  • R0J0hound No need to apologize, I appreciate your reply and help.

    Actually, there a problem, I can't open your .capx due to missing .XML files inside, it's known bug if you make .caproj, then save as .capx and it doesn't save Layout folder.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • R0J0hound Nevermind, I managed to fix your .capx, my old .capx has Layout folder inside, then I dragged into your .capx and it works!

    It's working very well, now I would like to complete my doubt if you don't mind, I was worrying how to manage to fall the gems after of a chain reaction, other gems should go fall when aren't connected to gems.

    This is example which is made by yourself, I'm looking a possible solution to set gray area to wide without using distance, imagine the top acts as source of connection, if other gems are disconnected to gray area, they should fall.

    https://dl.dropboxusercontent.com/u/762 ... nnect.capx

  • Joannesalfa

    For that one remove the "mark neighbors" call in event 5 and add another event right below:

    tile y=32:

    ---- tile set marked to true

  • R0J0hound Gotcha, good one! Thank you a lot, I will integrate this example to bubble shooter, I hope everything is fine.

  • R0J0hound

    Hi again, I hope you are fine, actually I'm frustrated about chain reaction, I did 60 hours of playtest and I found something irregular I've created 2 gifs to understand you better.

    1. Try to shoot in order target like that gif, sometimes when bubble is snapped, then execute a floodfill which is created by you, it's rarely ignored and won't do chain reaction.

    2. Using snap which is from your older example about bubble shooter, sometimes to snap between the walls, it goes to out of window.

    I was trying to figure out with some intentions but got no results, would you mind to help me again?

  • For #1 are triggering a floodfill when just hitting a ceiling. It doesn't look like it is.

    For #2 I've noticed the snapping doesn't seem right at times. The equations I used do what they were designed to do: find which square on a staggered grid to snap to.

    I did a test to evaluate the equation.

    https://dl.dropboxusercontent.com/u/542 ... p_hex.capx

    The formula is about the same as in the bubble shooter capx I've made before. I also compared it to just picking the nearest grid sprite which would be perfect minus the need all the sprites. Anyway there are subtle differences in the gaps. My conclusion is a new formula needs to be found so that snapping isn't done to the nearest square but the nearest hexagon, which would mirror using picking nearest.

    A internet search for "snap to hex grid" would probably be the next step.

    After that the issue of snapping into walls or other jewels may still be there and require another solution.

  • R0J0hound Sorry, I don't follow about your #1 as hitting a ceiling... with updated equation from your .capx, still same result.

    There an group of events that are part of your floodfill that rarely ignores match 3 like the #1 gif.

    More details about snap, also I've changed the snap equation from your .capx and I got same results:

    Actually I don't think snap to hex grid isn't a big issue but chain reaction is, I had no idea implement to pick the nearest grid sprite but I did instead of On collision, it wouldn't work after all.

  • R0J0hound Actually, I've fixed first gif, I really don't want to waste your time, how I did fix about chain reaction was change action Set position detector to gems from While loop to For each and changed collision polygon, it worked to prevent irregular chain reaction.

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