Jump to content

How to find first non-zero element in tile layer in Tiled map


gmalone
 Share

Recommended Posts

After much searching and not finding, I must ask:

 

 

I'm wanting to scan through a tilemap layer looking for the first non-zero tile element in that layer (happens to be the collision layer).  I know how to find the element in the JSON file, but I want to automate that in the game due to the fact reshuffling my tilesets causes the collision tile index to change.

 

When I try to use the Tilemap.searchTileIndex(....) function,

 

thusly,  var cID = game.map.searchTileIndex(<a tile index#>, 0, false, game.CollisionLayer)

 

I get an odd error "game.map.searchTileIndex is not a function"

 
Looking inside phaser.js I cannot find any reference to searchTileIndex at all.  Surely I'm missing something, but...
 
Any help would be appreciated.
 
 

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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