Request: Destroy all sprites action

Discussion and feedback on Construct 2

Post » Mon Mar 18, 2013 4:55 am

I think it would be handy to have a "destroy all sprites/objects" action. This could be used before changing level because many times there will be a few sprites that remain on screen when changing level (for instance I usually see bullets continue flying across the screen after changing level.)
B
134
S
65
G
16
Posts: 1,766
Reputation: 19,190

Post » Mon Mar 18, 2013 6:09 am

I second this idea.
Project Lead of Zems Online Card Game

Producer at Impulse Limited
B
18
S
6
G
3
Posts: 677
Reputation: 5,194

Post » Mon Mar 18, 2013 7:17 am

When the layout is changed all objects that are not global are destroyed.

@alspal if your bullets are not set to be global then I'd say its a bug that they are not destroyed on a layout change.

The only point where I think it may be useful to destroy everything is at a layout change, but you can do that now by making all the objects not global.
B
79
S
24
G
54
Posts: 4,755
Reputation: 40,773

Post » Mon Mar 18, 2013 7:19 am

I am assuming that your levels are on the same layout. A common practice is each level is a layout. As R0J0hound said, switching layouts destroys all non global objects...
B
49
S
11
G
10
Posts: 1,833
Reputation: 14,428

Post » Mon Mar 18, 2013 8:38 am

I don't think I use global on anything. I guess it's a bug then, it seems like the persistance of sprites happens when they've been recently created before the layout change but I'm not sure. Seeing that I can't replicate or figure out why it happens that's why I suggest adding this destroy feature, since Ashley usually requires specific directions for encountering bugs.
B
134
S
65
G
16
Posts: 1,766
Reputation: 19,190

Post » Mon Mar 18, 2013 1:22 pm

The engine definitely does destroy all non-global objects when switching layout, so I would say the most likely cause is you accidentally made some objects global.

Still, you can already do a 'destroy all objects' type event by putting a 'destroy' action under a 'pick all instances' event.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,630

Post » Wed Nov 05, 2014 8:47 pm

How does one control the scope of procedurally generated sprites? Do they adopt the properties of the pre-existing mandatory sprite?
https://www.ravenheart.ca/home
Company name changed to avoid Facebook-type shenanigans

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
18
S
5
G
1
Posts: 1,144
Reputation: 4,066

Post » Wed Nov 05, 2014 11:36 pm

I usually put all my destroyable object in a family and destroy that family on start of layout.
Image
B
59
S
21
G
11
Posts: 482
Reputation: 10,718

Post » Thu Nov 06, 2014 12:40 am

This would be useful for those dynamically loading levels via external files. You could use families but this would be a little easier I suppose.
Image
B
225
S
27
G
13
Posts: 1,774
Reputation: 18,024

Post » Thu Nov 06, 2014 12:40 am

Ashley wrote:The engine definitely does destroy all non-global objects when switching layout, so I would say the most likely cause is you accidentally made some objects global.

Still, you can already do a 'destroy all objects' type event by putting a 'destroy' action under a 'pick all instances' event.


I noticed it sometimes doesn't destroy particles already in flight, ie. one-shot spray and rarely, sprites with a short fade out. Not sure why but i never set global for any object.
B
60
S
21
G
18
Posts: 1,741
Reputation: 16,800

Next

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 5 guests