Closed elgansayer closed 10 years ago
I'm experiencing the same issue with Phaser 2.0.5. An alternative to removing a tile could be to set it's index to 0, but that results in this error:
Uncaught TypeError: Cannot read property '2' of undefined phaser.js:54889
Phaser.TilemapLayer.render phaser.js:54889
Phaser.TilemapLayer.postUpdate phaser.js:54540
Phaser.Group.postUpdate phaser.js:17659
Phaser.Stage.postUpdate phaser.js:16295
Phaser.Game.update phaser.js:20000
Phaser.RequestAnimationFrame.updateRAF phaser.js:35470
_onLoop phaser.js:35456
I've checked through this and removeTile and removeAll doesn't null anything anymore, it just creates -1 indexed tiles. I've searched the whole of Tilemap.js for = null
and it's not happening anywhere, so I'm going to close this off unless you've a test case you can show me please.
If you use getTile, it works well,
if you then delete that tile using removeTile()
it clears the data, and then if you use getTile on the same coord's, it crashes at this line;
this.layers[layer].data[y][x].index ()
this.layers[layer].data[y][x] is NULL, undefined. removed;
so this would also explain why hasTile is true for tiles that are not actually there?
removeTile, and non tile's are not being set to -1 somewhere, Tomorrow's adventure time .
for now, im just going to use a check if(!this.layers[layer].data[y][x] ) { return null; };