jdnichollsc Posted September 1, 2015 Share Posted September 1, 2015 Hi guys, How can I destroy tiles from TilemapLayer using an Array of indices? Regards, Nicholls Link to comment Share on other sites More sharing options...
jdnichollsc Posted September 1, 2015 Author Share Posted September 1, 2015 My solution:var tilesToRemove = [41, 42];var tiles = this.layer.getTiles(0, 0, this.layer.width, this.layer.height);self = this;tiles.forEach(function(tile){ if(tilesToRemove.indexOf(tile.index) >= 0) self.map.removeTile(tile.x, tile.y, self.layer);});Regards, Nicholls Link to comment Share on other sites More sharing options...
Recommended Posts