woratana Posted December 17, 2013 Share Posted December 17, 2013 Hello,I impressed with how easy Phaser is to setup emitter I would like to know if I can do the fading out effect on emitter after it shoot? Link to comment Share on other sites More sharing options...
XekeDeath Posted December 17, 2013 Share Posted December 17, 2013 I was wondering that myself when I started...Then it occurred to me that an emitter is just an extended group, so you get access to all the group functions, like forEachAlive!What I do is put this in the update function:myEmitter.forEachAlive(function(particle){ particle.alpha = game.math.clamp(particle.lifespan / 1000, 0, 1);}, this);This will fade out each particle in the last second of its life... For added effect, you can change the lifespan of individual particles when you create them. Link to comment Share on other sites More sharing options...
woratana Posted December 17, 2013 Author Share Posted December 17, 2013 Thank you for introducing me the alpha property! I have been finding property name 'opacity' but couldn't find one :/ Link to comment Share on other sites More sharing options...
Recommended Posts