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.
theDeletr - check your sprite collision masks in the image editor and also your event sheets for anything that might destroy bricks unintentionally.
Develop games in your browser. Powerful, performant & highly capable.
i checked the collision masks and my events I cant find any reason for the superfluous explosions.
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)
Button OnClick: Destroy Sprite - will destroy all Sprite instances at the same time.
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..
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.