Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

Arcade Particles and Individual Emissions


danbolt
 Share

Recommended Posts

Hey friends,

 

I'm incredibly fond of Phaser and it's flexibility for making games, both big and small.

 

The included Arcade Particles are really slick, too. One thing I really liked about 2.4.4  was that Particles.Arcade.Emitter.emitParticle enabled me to specify a key and frame when shooting a single particle out.

 

Right now I'm making a platformer where I'm emitting a few deliberate particles at specific events. An example is below:

 

post-15417-0-62225200-1446706531.gif

 

All of my particles use the same sheet, but different particles can have different images, velocities, and lifespans.

 

At the moment, I typically have to achieve this by doing:

 

emitter.setXSpeed(dX, dX);emitter.setYSpeed(dY, dY);emitter.lifespan = someLifespan;emitter.emitParticle(x, y, key, frame);
 

I'd prefer to have one emitter that I can pass parameters to individual particles. I could wrap emitParticle in a new function, but I was curious if anyone had a better solution I'm not aware of.

 

I've also created a pull request for adding lifespan as an optional parameter to emitParticle as well. It's not exactly for the original intended use case of Emitter, but I think that would help developers in a similar situation to myself.

 

Cheers!

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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