drawcall / Proton

Javascript particle animation library
https://drawcall.github.io/Proton/
MIT License
2.41k stars 275 forks source link

Removing Emitter leaves particles #55

Closed jramstedt closed 5 years ago

jramstedt commented 6 years ago

Removing Emitter stops updating emitted particles and they are left on screen.

I expect particles to die normally after emitter is removed.

I have done a workaround that calls Emitter.stop() and waits for max lifetime and then calls Emitter.destroy()

mperronc commented 6 years ago

There is a also a method removeAllParticles() on Emitter that sets all its particles "dead" flag to true. Calling update() after that destroys all the particles properly.

Kinda threw me off as well.

jramstedt commented 6 years ago

What I expected was that particles to run their normal course and die. Like for example fade away.