Jump to content

Can we have multiple bodies of Arcade physics to single sprite?


naveen
 Share

Recommended Posts

No, but you can detect which direction the collision is coming from by using touching:

game.physics.arcade.collide(player, obstacles, function(player, obstacle) {  if (player.body.touching.left || player.body.touching.right) {    // do something for a horizontal collision  }  else if (player.body.touching.up || player.body.touching.down) {    // else do something for a vertical collision  }});
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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