Jump to content

Phaser P2 Physics check for collision with specific tile


anthkris
 Share

Recommended Posts

Howdy,

I'm tearing my hair out trying to figure this out. I have a tilemap made in Tiled. Everything is displaying correctly and the player is colliding correctly. I want to check whether or not the player is colliding with a certain tile (for example, a water tile or a spike tile) and if so, kill the player.

I've done a lot of searching and so far I've tried:

  • setTileIndexCallback: this has had absolutely no effect. I can't get the console message to show at all.
  • Collision groups: I've set the collision groups for the player and the tilemap but that didn't seem to do anything

I'm not sure what to do.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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