Destroy objects when 3 of the same connect?

Get help using Construct 2

Post » Fri Feb 22, 2013 11:41 pm

Hi There, first time posting on the forums. I have searched the forums looking for an answer to my question, and am not sure I am correctly stating the search terms to find an answer so I am posting this.

The situation:
There are two types of circles, one is red, one is blue.
When the circles come in contact with one another, no matter the color, they stick together.
When a circle contacts another circle of the same color that is through direct touch in contact with a third circle of the same color, these circles will destroy themselves.

As an example, think of puzzle bobble. When you shoot one of the balls into a chain of balls the same color as it, they explode, but just two balls of the same color touching does not make them explode.



The problem:
I can make the circles all stick together, but how can I make it so that the circles know when they have direct contact with three or more of their same color to explode?

I have successfully made them explode when two of the same color attach, but that is through very simple means of making them destroy themselves when they touch themselves.

I don't know if this is possible, but if it is and someone can point me in the right direction i'd be very grateful.

Thanks for your time and hopefully thanks for not making any balls touching each other jokes.

-adamnickervision2013-02-22 23:50:25
B
5
S
1
G
1
Posts: 13
Reputation: 610

Post » Sat Feb 23, 2013 6:00 am

Hi, you can use "is overlapping at offset" condition, and then check for colors or values, or have an invisible sprite that checks the value of the balls overlapping with it.

This was my first game, you have to click where 3 or more of the same color are next to each other, same principle but it waits for the "click'

Image
B
42
S
11
G
5
Posts: 269
Reputation: 10,790

Post » Sat Feb 23, 2013 7:08 pm

B
79
S
24
G
53
Posts: 4,731
Reputation: 40,225

Post » Sun Feb 24, 2013 1:13 am

Thanks for the replies guys, I am going to dig through these suggestions and try to make something work for my test concept. :)
B
5
S
1
G
1
Posts: 13
Reputation: 610


Return to How do I....?

Who is online

Users browsing this forum: Braus, Draconinho, Magistross, nedzad, R0J0hound and 28 guests