Hello.
I’m trying to change the map in the scene when the player is overlap with the zone in front of the door.
But it seems overwrite the tileset attribute in the layer doesn’t working as I thought.
If there anyway to change the rendered tileMap without changing the scene?
The part to set the map and layer looks like this.
this.map = this.make.tilemap({
tileHeight: tileSize, // Need to match the height of the image for each tile
tileWidth: tileSize, // Need to match the width of the image for each tile
data: room,
});
console.log('map :>>>', this.map);
const tileset = this.map.addTilesetImage('tiles');
if (this.groundLayer && tileset) {
this.groundLayer.tileset = [tileset];
} else {
// Create a new layer
this.groundLayer = this.map.createLayer(0, tileset ? tileset : [], 0, 0);
}