davychen Posted January 13, 2016 Author Share Posted January 13, 2016 Wingy, your demos are great, the second looks like fireworks.......... i think i'll use it in my games........ Wingnut 1 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted January 14, 2016 Share Posted January 14, 2016 Thanks, and hello again, DC! The important question is... did YOU get the info you needed? I hope so. It would be handy if our particle systems were able to generate an "allParticlesDead" event or callback. Unfortunately, it does not look possible/wise. So, I guess, the delayed-start particles.length-checker... is a viable option. http://playground.babylonjs.com/#206JUO#5 (Lines 68-75). I put the timer on the particle system itself. I tried to change all 'ps1' to 'this' in that function, but I failed. I was trying to get a particleSystem for you... that was self-contained. Your game... because of its rapid-fire feature (which I love)... needs to allow many particle explosions happening at the same time. This is why re-using the same particle system without disposing... won't work for you. You already know that. The time-based particle explosion WOULD work, maybe. http://playground.babylonjs.com/#206JUO#7 Not a bad momentary explosion, thanks to line 46 - ps1.targetStopDuration = .25; The particles seem to have proper time to die of old age... before the particleSystem is disposed. It looks pretty good... no extra timer needed. I like it. I turned OFF manualEmitCount and set an emitRate in lines 43-44. I still have disposeOnStop in line 67. You can ignore/remove lines 72-74. They are only for checking if scene.particleSystems finished empty after the previous RUN. It properly ends empty, yay! Maybe, using targetStopDuration will work better than manualEmitCount for your game. *shrug* It is worth testing, I think. Fun experiments! Good luck... keep us updated on your games and experiments, DC! Quote Link to comment Share on other sites More sharing options...
davychen Posted January 29, 2016 Author Share Posted January 29, 2016 hi Wingy, i was away for a few days, forgot to tell you, your way of setting " targetStopDuration", save me a lot of time, it's easy and useful. or i'll have to save a timestamp for each PS, and check them from time to time. thanks. Wingnut 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.