Bubble Shooter advice needed

Get help using Construct 2

Post » Tue Oct 08, 2013 4:29 pm

Hi to all,


i've started to work on a Bubble Shooter game, i've managed to develop the part regarding destruction between bubbles with same color. Now the only issue is how to find/destroy bubbles and group of bubbles which does not have any neighbor, like the group marked with red from this image:



Any advice is welcome.
By the way, Construct 2 is a great game engine. Well done Scirra!


Edit: image broken link.cosmin2013-10-08 16:36:50
B
5
Posts: 10
Reputation: 270

Post » Tue Oct 08, 2013 4:38 pm

Check your image link, this forum seems to have some sort of black list for hosting.

If you use DropBox or Google drive, you may want to choose a different image host.

I do not have any problems using Dropbox or google drive on any other forum but this one, I have no idea why anyone would black list them.

Pretty ironic having my C2 html5 projects unplayable from the C2 forum.
B
29
S
8
G
4
Posts: 767
Reputation: 5,985

Post » Tue Oct 08, 2013 4:42 pm

Thank you for your advice @jojoe, i've fixed it.
B
5
Posts: 10
Reputation: 270

Post » Tue Oct 08, 2013 4:59 pm

Try using the collision at offset to check what is adjacent to your bubble sprite.

You might also want to use an array to draw your bubbles, and use the array matrix to check what is next to the bubble in question.

RegEx might also be really helpful for this, but I can not find any good regex tutorials on the forums.
B
29
S
8
G
4
Posts: 767
Reputation: 5,985

Post » Tue Oct 08, 2013 5:05 pm

Thank you @jojoe, i will give it a try
B
5
Posts: 10
Reputation: 270

Post » Tue Oct 08, 2013 5:15 pm

Glad you find it useful.

Here is my favorite (tiny) tutorial on arrays:
https://www.scirra.com/tutorials/360/generating-a-random-tile-map

For a quick-n-dirty way of doing things, have your "bullet-bubble" spawn an invisible Kill sprite, in all 8 directions around the "bullet-bubble" that kills all other bubbles of the same color.

Example:

Player shoots a RED "bullet-bubble",
bubble collides with another bubble, triggers the "bullet-bubble" to stop, RED "bullet-bubble" spawns a "Kill-red-bubble" sprite in all 8 directions.
When the stationary bubbles get hit by a kill red sprite, and it is red, it destroys itself, and spawns 8 kill-red sprites like the bullet bubble did.

This will cause a chain reaction, like puzzle bobble, but will leave some bubbles floating, and unattached. (in puzzle bobble, floating islands of bubbles destroys, and gives player score)
B
29
S
8
G
4
Posts: 767
Reputation: 5,985

Post » Tue Oct 08, 2013 5:59 pm

@joejoe your idea with "kill-bubble" is interesting, for destroying the bubbles with same color i've used a "flood fill" technique, now, the only issue is with finding the "floating bubbles". My ideea is to use the object's matrix array, to search for "floating bubbles" and groups of bubbles. To find individual bubbles with no neighbors is easy, but the hard part is to find the groups of bubbles.
B
5
Posts: 10
Reputation: 270

Post » Tue Oct 08, 2013 7:40 pm

ok, maybe the chain reaction idea again. only with a sensor for the top of the game board.

PLayer shoots bullet-bubble, hits a stationary bubble and stops.

Sets a local variable for "selected,

Spawns sensor sprites in all 8 directions.

If a bubble collides with a sensor sprite, it spawns sensor sprites in all 8 directions. after setting its own "selected instance variable"

If after the chain reaction is over, and the top sensor bar does not receive a sensor sprite collision , then all selected sprites destroy.

The top sensor will only be hit by connected chain reactions.

Hope that helps.
B
29
S
8
G
4
Posts: 767
Reputation: 5,985

Post » Tue Oct 08, 2013 8:22 pm

it looks like a good method, also i will give it a try. Thank you for your ideas @jojoe, they really helped me a lot
B
5
Posts: 10
Reputation: 270

Post » Tue Oct 08, 2013 8:27 pm

You are welcome. Make sure you make the sensor sprites smaller than the bubble sprites to avoid "collision overflow". A sensor sprite about half the size will do just fine.
B
29
S
8
G
4
Posts: 767
Reputation: 5,985

Next

Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, Shenkai the ssj and 24 guests