Selecting a specific group of sprites to be destoryed

Get help using Construct 2

Post » Sat Jun 24, 2017 10:19 pm

Message: DivineVoider can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Hello, I've created a specific enemy which works by having 1 sprite fly around on the screen and having the other 4 pieces follow it using Pin (Bar style) . When i spawn the first piece i tell it to spawn the other four pieces and pin then and it's all working great. However, When i have more than 1 of these enemies spawned it cannot tell which sprites i want to destory so it destroys all of them. Please help!
My game: ... on=updated
(Press E to spawn more enemies & Q to destory them all)
Hold down Left mouse button to charge up the bow and fire arrows.
Posts: 1
Reputation: 206

Post » Sun Jun 25, 2017 11:34 am

Add an instance variable ID to the enemies, first enemy id=1, second enemy id =2 etc. And when you want to destroy specific enemy call an event enemy -> enemy id==1 -> enemy destroy.

This can change on how you want the enemies to be killed, using bullets or on a press of button etc.
Like my work? Fallow me on social media, and see my games on the arcade.
Posts: 298
Reputation: 5,402

Return to How do I....?

Who is online

Users browsing this forum: Sproadic and 6 guests