How do I make my fireball work

Just started using Construct 2? Post your questions here

Post » Wed Mar 19, 2014 10:22 pm

Im making a clone of brickbreaker and when my fireball (red ball) hits a brick all the bricks touching that brick are supposed to blow up. However bricks that are nowhere near the brick that is hit also get destroyed I have been looking at my code and cannot find the error. Any ideas, suggestions, solutions, theories on world domination?

link to capx is below.

dropbox.com/s/osz60dko5ic6frs/Indy_16export2real.capx
B
6
S
1
Posts: 47
Reputation: 759

Post » Thu Mar 20, 2014 5:11 pm

@theDeletr - check your sprite collision masks in the image editor and also your event sheets for anything that might destroy bricks unintentionally.
B
33
S
7
G
8
Posts: 312
Reputation: 8,528

Post » Wed Mar 26, 2014 2:05 am

i checked the collision masks and my events I cant find any reason for the superfluous explosions.
B
6
S
1
Posts: 47
Reputation: 759

Post » Wed Mar 26, 2014 3:37 am

how did you make your bricks? are they cloned objects or did you just cut and paste? if you used cut & paste in the editor it makes another instance of that object, not a new object.

so if you Destroy that object, it will destroy all objects unless you pick them individually.. (by it's UID)

To avoid this, make sure you are always picking by UID. Or the event that triggers is based on an individual object like:

Sprite1 OnCollision - Destroy Sprite (this will only destroy that one instance of that object)

opposed to:

Button OnClick: Destroy Sprite - will destroy all Sprite instances at the same time.
B
98
S
32
G
16
Posts: 1,204
Reputation: 16,715

Post » Wed Mar 26, 2014 9:13 am

I'v been out of programming with construct for a while, but if you replace the system "pick all brick" with system "for each brick" you should be fine, I guess..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Mar 26, 2014 5:04 pm

thnx
B
6
S
1
Posts: 47
Reputation: 759

Post » Wed Mar 26, 2014 5:06 pm

The bricks are clones I think. If you have seen Lee Stemkoski's breakout cone tutorial, I place my bricks the same way that he did.
B
6
S
1
Posts: 47
Reputation: 759


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 1 guest