How do I delete all instance of a particular type?

Get help using Construct 2

Post » Fri Mar 23, 2012 6:37 pm

[QUOTE=mindgear] [QUOTE=Kyatric] Here is your corrected example

What's the point of spawning instances and destroying them in the same row anyway ?

Also it had more to see with the order and how events work.[/QUOTE]

There is no point! :-) It was just an example to illustrate that I got an unexpected result from performing a series of actions.

If i create x object, iterate and destroy them, I should end up with zero objects. My example just demonstrates that this is not what happens.


Here is a different version of my example that works.

I understand why this works, but I'm still puzzled that the first version did not.... Well Ill try to make this work in my game.... Thanks for the feedback/help.
Posts: 31
Reputation: 1,162

Post » Fri Mar 23, 2012 6:47 pm

Because your first version used several "Start of layout" events.
In the end they were combined to be only one.
So it was like if you created instances, destroyed them, added some more, all in a row in a single tick.
Once again it is a matter of order and how events work.

Also in your current version, you don't need the event 3.
Just have an action "Pawn _ Destroy" in the event 2 (on Destroyer clicked) it will delete/apply to all instances of pawn.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Posts: 7,357
Reputation: 72,828


Return to How do I....?

Who is online

Users browsing this forum: blackhornet and 29 guests