Jump to content

Sprite vs TilemapLayer - separates even when processCallback returns false? Even when using overlap instead of collide?!?


wayfinder
 Share

Recommended Posts

I wonder if it's something I'm doing wrong or a bug - I'm trying to set up my own separation for a sprite vs tilemap layer collision, but whatever I do, the standard separation seems to happen. I went through the calls and it looks like the (2nd?) separation check (in "if (separateTile)") actually separates, even when it's supposed to be overlap only, even when the processCallback returns false - am I going crazy?

Link to comment
Share on other sites

found this in phaser.js:

 

 /**    * An internal function. Use Phaser.Physics.Arcade.collide instead.    *    * @method Phaser.Physics.Arcade#collideSpriteVsTilemapLayer    * @private    * @param {Phaser.Sprite} sprite - The sprite to check.    * @param {Phaser.TilemapLayer} tilemapLayer - The layer to check.    * @param {function} collideCallback - An optional callback function that is called if the objects collide. The two objects will be passed to this function in the same order in which you specified them.    * @param {function} processCallback - A callback function that lets you perform additional checks against the two objects if they overlap. If this is set then collision will only happen if processCallback returns true. The two objects will be passed to this function in the same order in which you specified them.    * @param {object} callbackContext - The context in which to run the callbacks.    * @param {boolean} overlapOnly - Just run an overlap or a full collision.    */    collideSpriteVsTilemapLayer: function (sprite, tilemapLayer, collideCallback, processCallback, callbackContext) {......

 

So apparently overlapOnly is never passed when performing a collision or overlap check! (Same for group vs tilemaplayer)

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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