MichaelD Posted July 28, 2014 Share Posted July 28, 2014 Hello, I recently saw a very nice particle animation and I was wondering if someone can give me a hint of how can something like this be done with phaser particles. I have seen the examples but they don't show this kind of dynamic. http://codepen.io/netgfx/full/mlIps/ Thanks! Link to comment Share on other sites More sharing options...
lewster32 Posted July 28, 2014 Share Posted July 28, 2014 This looks pretty standard to me, it's just spawning square particles randomly in a fixed angle range with slight variations in velocity and scaling them down to zero over the particle lifetime. The different colours could be done by using white squares and tinting the particles depending on the surface the sprite is touching. This example kinda demonstrates how you'd add scaling over time, but the exact method is entirely yours to decide: http://examples.phaser.io/_site/view_full.html?d=particles&f=particle+class.js&t=particle%20class mtburdon and MichaelD 2 Link to comment Share on other sites More sharing options...
lewster32 Posted July 28, 2014 Share Posted July 28, 2014 Knocked up a little fiddle - didn't realise you could pass tween-style values to the setAlpha and setScale functions! http://jsfiddle.net/lewster32/wUX6j/ MichaelD 1 Link to comment Share on other sites More sharing options...
MichaelD Posted July 28, 2014 Author Share Posted July 28, 2014 Thanks that was really helpful! Link to comment Share on other sites More sharing options...
Recommended Posts