Hello all!
I'm make top down game in Phaser 3.9.0 and have a problem.
I'm created map in Tiled ver. 0.18.2. and export it in .CSV.
It turned out , 5 files = 5 layers.
How all of them combine to a mp?
My code.
function preload ()
{
this.load.image('tiles', 'assets/map/tileset/tilesheet.png');
this.load.tilemapCSV('map', 'assets/map/csv/world_ground.csv');
this.load.tilemapCSV('map', 'assets/map/csv/world_groundvariations.csv');
this.load.tilemapCSV('map', 'assets/map/csv/world_grass.csv');
//and other...
}
function create ()
{
//MAP
map = this.make.tilemap({key : 'map', tileWidth: 32, tileHeight: 32});
var tileset = map.addTilesetImage('tiles');
ground = map.createStaticLayer(0, tileset, 0, 0);
grass = map.createStaticLayer(1,tileset,0,0);
}
Error: Cannot create tilemap layer, invalid layer ID given: 1
This is what is displayed on the screen.
Only First Layer