Jump to content

Can't swap a tile.


danbruegge
 Share

Recommended Posts

Hi,

 

i'm trying to swap a tile but it didn't seem to work. When i try to use putTile instead, it will work.

map.setTileIndexCallback(2, function (sprite, tile) {    if (_game.input.keyboard.isDown(P.Keyboard.SPACEBAR)) {        map.swap(2, 4, tile.x, tile.y, tile.width, tile.height, tile.layer);        //map.putTile(4, tile.x, tile.y, layerItems);    }}, _game, layerItems);

It also get no feedback what is going wrong.

 

// Edit

Also, the same problem appears to the map.replace() method.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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