Jump to content

Phaser 2.3.0 collide fires more than one time each update


MichaelD
 Share

Recommended Posts

Hello, I'm seeing that the physics.arcade.collide between a sprite and a group fires more than once (2-3 times) each time the sprite collides with a group member (the callback says it is the correct and same group member). Is this normal in the new version?

 

Mind that I'm killing and removing the group member the first time of the collision but the next 2-3 times happen anyways.

 

Can anyone confirm that this is happening and whether or not this is normal?

 

Thanks!

Link to comment
Share on other sites

  • 1 month later...

Just as temporary solution, i coded this at the beginning of the callback function.

var elapsedTime = this.game.time.elapsedSince(this.dieTimer);if (elapsedTime < 100) return;this.dieTimer = this.game.time.time;

It appears that 100ms is enough to discard the other spurious calls.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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