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

Phaser Particle Spawn Position bug?


Son of Bryce
 Share

Recommended Posts

Hello Ya'll,

 

I seem to have encountered an issue with starting an emitter in burst mode. For what seems like a frame, it starts in an offset position then resumes in the correct position afterwards. I'm using code similar to the "click burst" demo, moving the emitter to where the collected item is.

//  Position the emitter where the mouse/touch event wasemitter.x = _posX;emitter.y = _posY;//  The first parameter sets the effect to "explode" which means all particles are emitted at once//  The second gives each particle a 2000ms lifespan//  The third is ignored when using burst/explode mode//  The final parameter (10) is how many particles will be emitted in this single burstemitter.start(true, 2000, null, 10);

I didn't dig through the code, but I think it's somehow related to the camera scrolling. It doesn't appear to happen when I turn the camera scrolling off.

 

And again, for one frame it's in an offset position but then afterwards it's in the correct position so adding the camera position to the emitter's probably not going to help any.

 

Any idea why it might be happening?

 

(and by the way I'm using 1.0.6a)

Link to comment
Share on other sites

Yeah there's a fix for this commit to the 1.0.7 branch - I'm considering changing how the camera is calculated entirely. After chatting with Mat we found a much more efficient way to handle it but it means dropping the ability for an object to have a scrollFactor property, which is something I always really liked (but at the same time it always introduced problems too :)

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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