Jump to content

setTileIndexCallback Question


Recommended Posts

I created a double layer tilemap and i tried to set a callback when the player touches a specific tile.



I put one of the mentioned tile on each layer and i used this: 

map = game.add.tilemap('map');map.addTilesetImage('spritesheet');layer= map.createLayer('Tile Layer 1');layer2= map.createLayer('Tile Layer 2');map.setTileIndexCallback(2, tileProperties, this);

It touches the tile on the first layer  and works fine.

Then i use :

map.setTileIndexCallback(2, tileProperties, this,layer2);

But the callback does not work.


Is there a way to make such callbacks on other layers besides the first?

What am i doing wrong?

Link to comment
Share on other sites


  • Recently Browsing   0 members

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