Jump to content

Help with TileIndexCallback


Recommended Posts

Heya, i'm making a sidescroller with ladders. When the player is over a ladder, which is a seperate layer this runs: 

 this._map.setTileIndexCallback([33, 43, 51, 61], this.player.setOnLadder, this.player, this._ladder_layer);

I use this to call the ladderfunction, disabling gravity. It works just fine.

My question is, can i resize the bounding box that calls the setTileIndexCallback? The tiles are 64x64, and i need the player to be in the middle of the sprite before setOnLadder is fired.

Could i resize the bounding box so its something like x = 4 and y = 64?

Or if you have some clever way of doing this, i'd like to hear it.

Thank you for your time :)

Link to comment
Share on other sites


  • Recently Browsing   0 members

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