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
151
S
75
G
20
Posts: 1,793
Reputation: 22,749

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,234

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
94
S
33
G
114
Posts: 5,359
Reputation: 73,779

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
12
G
10
Posts: 1,833
Reputation: 14,603

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
151
S
75
G
20
Posts: 1,793
Reputation: 22,749

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
399
S
236
G
89
Posts: 24,543
Reputation: 195,430

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
I don't check the forums much anymore, but I will receive an email for PMs.

"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
23
S
6
G
1
Posts: 1,419
Reputation: 4,857

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
80
S
30
G
12
Posts: 517
Reputation: 12,713

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
243
S
30
G
13
Posts: 1,787
Reputation: 18,770

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
70
S
24
G
19
Posts: 1,757
Reputation: 17,616

Next

Return to Construct 2 General

Who is online

Users browsing this forum: Cubeeo and 7 guests