Destroy Object

Get help using Construct 2

Post » Thu Dec 15, 2011 7:14 pm

Hi I set an object to be destroyed on collision then for another object to spawn, but when the object spawns when it is collided against it dosnt destroy here the link http://dl.dropbox.com/u/43013976/aircraft.capx
Thank you
B
15
S
2
G
1
Posts: 108
Reputation: 1,902

Post » Thu Dec 15, 2011 9:03 pm

The capx you give is not very clear.

When sprite 3 (black circle) collides with sprite 5 (red circle), the red circle is destroyed, the right arrow sprite4 is destroyed. (event 6)
Each time (every tick) the sprite3.x is inferior to 444, it spawns a right arrow. (event 7)
Also, every tick the text is visible, it spawns a red circle. (event 8)

So it spawns a lot of right arrows for nothing, as well as red circles.

You should rather than spawn and destroy simply make objects invisible, and test their visibility state when an action is supposed to happen.

Ex: event 5 add another condition "Sprite4 is visible".
This way, the action will only occur when the sprite is visible.
This way you don't need to delete it or spawn it again, simply set it to visible or invisible.

You might want to check out how events work again, it might help you out.
Restructuring your code should help to solve your issue.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,999
Reputation: 57,793

Post » Fri Dec 16, 2011 6:38 am

Ah yh thanks :)
B
15
S
2
G
1
Posts: 108
Reputation: 1,902


Return to How do I....?

Who is online

Users browsing this forum: R0J0hound, randomly, spcsmrf and 24 guests