Jump to content

Collision with sprite and tilemapLayer never calls collideCallback


Recommended Posts

In my game, this line:

game.physics.collide(player, layer["blue_wall"], blueWallCollisionHandle, null, this);

(Player is a sprite, and layer["blue_wall"] is a tilemapLayer)


blueWallCollisionHandle is never called.

I searched the collision function in the source, and I found that in the function collideSpriteVsTilemapLayer (in ArcadePhysics.js), this line:

if (this.separateTile(sprite.body, this._mapData[i]))

always return false, because separateTile don´t return a value, but set the value in this._result. And because of this, collideCallback isn´t called.

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...