How do I Destroy ALL Sprites Overlapping Certain Sprite

Get help using Construct 2

Post » Tue May 23, 2017 7:56 pm

I'm curious if there is a quick way to have all sprites that are overlapping one sprite in particular be destroyed. Or is the only way to accomplish that is to set an action for each of the sprites to be destroyed?

Thanks.
B
13
S
3
G
1
Posts: 23
Reputation: 1,432

Post » Tue May 23, 2017 8:41 pm

Families can help, but it depends how things are organized. Are these the same sprite, or different sprites?
ImageImageImage
B
71
S
21
G
231
Posts: 3,695
Reputation: 129,366

Post » Tue May 23, 2017 9:03 pm

Well the object overlapping another object condition with object destroy action will work. Lets say 5 sprites are overlapping the object, when destroy is called it will destroy all of them.

Image
Like my work? Fallow me on social media, and see my games on the arcade.
B
7
S
5
G
9
Posts: 298
Reputation: 5,367

Post » Wed May 24, 2017 1:59 am

blackhornet wrote:Families can help, but it depends how things are organized. Are these the same sprite, or different sprites?


All different. :)
B
13
S
3
G
1
Posts: 23
Reputation: 1,432

Post » Wed May 24, 2017 2:00 am

imhotep22 wrote:Well the object overlapping another object condition with object destroy action will work. Lets say 5 sprites are overlapping the object, when destroy is called it will destroy all of them.

Image


I'm going to have to play around with this feature more. Would I have to set each of the different sprites to destroy? Because that is a long list.
B
13
S
3
G
1
Posts: 23
Reputation: 1,432

Post » Wed May 24, 2017 2:04 am

That's where Families come in. If your master sprite is not one of the others, put the others in a Family, then check for overlapping the Family. Then just Family.Destroy.
ImageImageImage
B
71
S
21
G
231
Posts: 3,695
Reputation: 129,366

Post » Wed May 24, 2017 11:25 am

If you have construct license you can group your sprites in family and in the event system add the family instead of the individual objects.
Like my work? Fallow me on social media, and see my games on the arcade.
B
7
S
5
G
9
Posts: 298
Reputation: 5,367

Post » Wed May 24, 2017 3:16 pm

I had no clue there was even such a thing as families. Cool! I'll go take a look at the manual. It sounds exactly like what I might need. Thank you both. =]
B
13
S
3
G
1
Posts: 23
Reputation: 1,432


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 62 guests