Jump to content

Emit particles from one point to another ?


chusek
 Share

Recommended Posts

Not easily implementable with Phaser's default particle system, which only applies an initial force to particles. You could maybe write your own particle class but that'd be quite involved. I guess you need a particle system which has attractors built in like Proton, which works with pixi and thus with Phaser too.

Link to comment
Share on other sites

When you start your emitter change explode parameter (first one) to false and frequency (third one) to be less than tween time you use to move particle from one point to the next:

emitter.start(explode, lifespan, frequency, quantity) 

Link to comment
Share on other sites

Not easily implementable with Phaser's default particle system, which only applies an initial force to particles. You could maybe write your own particle class but that'd be quite involved. I guess you need a particle system which has attractors built in like Proton, which works with pixi and thus with Phaser too.

Thanks,but  now

How do I use Proton with Phaser ?

Link to comment
Share on other sites

So what I've got is Proton has its own renderer then it draw thing on canvas.... or in this case PIXI stage by 

pixiStage.addChild(particle.sprite); //particle.sprite was created by Proton

now I have no idea how to do this in Phaser.

Link to comment
Share on other sites

Finally got it, !!!!!!!

Original Proton + PIXI

renderer.onParticleCreated = function(particle) {var particleSprite = new PIXI.Sprite(particle.target);     particle.sprite = particleSprite;     pixiStage.addChild(particle.sprite);};

// change into

renderer.onParticleCreated = function(particle) {     var particleSprite = game.add.sprite(0,0,particle.target);     particle.sprite = particleSprite;};

I notice it doesn't pool - recycle particle.

Link to comment
Share on other sites

Summary: as lewster32 suggested. It's quite messy to tween particles to the point I want.
The keyword here is the attractor.
Proton is html 5 particle engine with attractor.
https://github.com/flashhawk/spp.js This is another option.

I make my random choice since both doesn't have documentation.
There's this Proton example that draw on PIXI stage 
http://www.a-jie.cn/proton/example/render/custom/pixijs.html

I edit the thing to work with Phaser.

not perfect but works
Tested working with cocoon js

https://github.com/chusek/Proton-phaser/

my first time on github !.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...