Jump to content

body touching callback?


veggis
 Share

Recommended Posts

I'm pretty sure 

body.touching

never cares to check to see what it's touching.  

In order to do this, you'll probably want to add all the sprites that you want to affect by touching to a group, then call 

game.physics.arcade.collide(sprite, group, function(sprite, collidedSpriteFromGroup) {
  //affect collidedSpriteFromGroup here
});

inside your update loop.

This example uses overlap instead of collide, but it's effectively the same thing:
http://phaser.io/examples/v2/arcade-physics/custom-sprite-vs-group

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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