BkoChan Posted September 22, 2016 Share Posted September 22, 2016 I'm trying to make a construction game where the player has to place powerlines and water pipes. I'm trying to bunch all this together in a single tilemap. What I want is a layer to draw powerlines and a layer to draw pipes but I can't figure out how to assign a tileset to a particular layer? // Create the tilemap oGame.tilemap = oGame.add.tilemap(); // Add tilesets to the map oGame.tilemap.addTilesetImage('ts_power_lines'); oGame.tilemap.addTilesetImage('ts_water_pipes_small'); // Create tilemap layers oGame.tilemapLayers = { 'waterSupply': oGame.tilemap.create('waterSupply', 40, 40, _iTileSize, _iTileSize), 'electricSupply': oGame.tilemap.createBlankLayer('electricSupply', 40, 40, _iTileSize, _iTileSize) }; // Resize the world to the correct size oGame.tilemapLayers.waterSupply.resizeWorld(); // Draw tiles oGame.tilemap.putTile(0, 10, 6, 'waterSupply'); oGame.tilemap.putTile(0, 10, 6, 'electricSupply'); Link to comment Share on other sites More sharing options...
Recommended Posts