universaljs Posted April 7, 2016 Share Posted April 7, 2016 Hello 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 More sharing options...
drhayes Posted April 8, 2016 Share Posted April 8, 2016 I'm not sure what you mean by "disables collisions". I have tile index callbacks with my collision layer and sprites can still collide with it. You're not seeing the console log? Link to comment Share on other sites More sharing options...
universaljs Posted April 8, 2016 Author Share Posted April 8, 2016 Hi, thx for the answer. The collision is visible in the console.log but does not stop the object on the elements of the collision map... Link to comment Share on other sites More sharing options...
drhayes Posted April 11, 2016 Share Posted April 11, 2016 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 More sharing options...
Recommended Posts