Jump to content

setTileIndexCallback and enabled collision...


Recommended Posts


I try create callback function - when exist collision, but in phaser I found only this method: setTileIndexCallback - but this method disables collisions. 

map.setTileIndexCallback([9,10,11,12], function(){ console.log("callback and collision...?");})

Does anyone have an idea how to create a collision with a tile-map of the callback function?

Link to comment
Share on other sites

I *think* I understand what's going on. This sets a custom callback when something collides with those tiles. But it doesn't do a physics collision. You need to use one of the physics systems' collision methods for that, like "game.physics.arcade.collide(things, otherThings, this.handleCollision, null, this);".

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

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