trouble with destroying enemies with particle trails

Get help using Construct 2

Post » Fri Nov 04, 2016 12:30 am

Hi there,

So I have this game where i'm spawning enemies that are basically bullets with a smoke particle trailing behind

http://part12studios.com/temp/Games/SMoD/SMoD_05/

but here's the thing.. i have a fade on the particles.. so when the enemy hits the player.. i can do anything i want with the bullet object (asteroid) but basically when i say "fade" all of the particles in the scene fade

particles are troublesome too because they don't have collision.. i can't say "on collide" otherwise it would be no problem..

so i think that's the main question.. any ideas on how i could manage particles individually.. ones that are partnered to multiple enemy bullet objects.

Any insight would be helpful. I'm sure there is something elegant i'm missing out that's obvious.. but my brain's getting fried at this point..

Thanks!
Caleb
B
59
S
9
G
1
Posts: 942
Reputation: 6,553

Post » Fri Nov 04, 2016 1:01 am

Try a Container, or just give the particles an instance variable set to the bullet.UID, then when the bullet is destroyed, pick all particles with that same stored UID, and destroy them.
ImageImageImage
B
71
S
22
G
247
Posts: 3,756
Reputation: 137,558

Post » Fri Nov 04, 2016 1:13 am

i agree with @blackhornet. Try the container thing :D and when the bullet is destroyed then destroy the particle that hitted the with bullet.
B
79
S
31
G
7
Posts: 148
Reputation: 9,179

Post » Fri Nov 04, 2016 1:22 am

oh containter! omg, i forgot about those.. i was trying families.. and sprites / particles can't group in families.. thanks i'll try that!
B
59
S
9
G
1
Posts: 942
Reputation: 6,553

Post » Fri Nov 04, 2016 1:40 am

The problem with containers and particles is that when the particle object is destroyed along with its parent object, so are all of its emissions.
Making the Particle object one-shot has issues as well.
Image ImageImage
B
170
S
50
G
179
Posts: 8,378
Reputation: 113,425

Post » Fri Nov 04, 2016 10:20 am

thanks for the tip newt! i'll keep an eye out for that. maybe on destroy, spawn another particle effect to create the illusions..

one thing i still notice is that they don't have a random rotation option.. i really need to put in a request for that.. so when the objects appear they are not all the same orientation.. looks more organic if each spawns randomly 0-359 degrees.
B
59
S
9
G
1
Posts: 942
Reputation: 6,553


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 9 guests