Destroy objects depending on others

Get help using Construct 2

Post » Thu Mar 21, 2013 11:11 pm

Hi, This forum has been great help with the other questions I have asked, so after some searching I have decided to ask another question.

If I have a mechanic similar to how puzzle bobble works, how do I make dependent chains fall off when their only connection to the roof has been destroyed?



Here is the capx I have been toying around with.

https://docs.google.com/file/d/0B-YaB0xL6KK2TWU4Q2hsUzdUSGM/edit?usp=sharing

I have the balls able to destroy when three touch now, but If I were to destroy three that were touching, and there is others connected to their bottom, they will remain, how do I make them fall or destroy?

Thanks for any help. If it doesnt make sense, ask me any questions and ill explain more about what I am trying to do.
B
5
S
1
G
1
Posts: 13
Reputation: 610

Post » Fri Mar 22, 2013 4:43 pm

I have been trying at this since yesterday and can't seem to sort it out. Anyone with advice would be greatly appreciated :)

Thanks.
B
5
S
1
G
1
Posts: 13
Reputation: 610

Post » Fri Mar 22, 2013 6:28 pm

Have a look here for one solution:
http://www.scirra.com/FORUM/bubble-shooter-ball-colisions-placement_topic62091_post381423.html#381423

Basically i used a instance variable for each bubble that tells is it's connected or not. If a bubble touches the top of the layout or another bubble that is connected then it is connected.
B
79
S
24
G
54
Posts: 4,749
Reputation: 40,761

Post » Fri Mar 22, 2013 6:42 pm

I am just heading to lunch, but I quickly downloaded your file to take a look. Based on the quick glance and your comments this sounds to be exactly what I was looking for. I will let you know how it works out when I get back home and try to incorporate it. Thanks for the help.
B
5
S
1
G
1
Posts: 13
Reputation: 610

Post » Fri Mar 22, 2013 10:48 pm

Ok, so I walked through your code step by step to build it into my program. The mouse clicking seems to work exactly as it does in yours, but for some reason I cant get the clean group to activate upon a specific ball being destroyed. I am working on it at the moment. I just wanted to let you know that you have definitely been very helpful. Thanks again.
B
5
S
1
G
1
Posts: 13
Reputation: 610


Return to How do I....?

Who is online

Users browsing this forum: PixelatedTrip and 0 guests