longzma11 Posted June 12, 2014 Share Posted June 12, 2014 I want to use tiled map editor to design map in phaser. I'm a newbie about game developer. Link to comment Share on other sites More sharing options...
SignalSin Posted June 13, 2014 Share Posted June 13, 2014 Here's the example provided on the Phaser website. The first step is to make a map in Tiled and export it as a json file.Next, put the json file and the spritesheet used to create the map in assets folder of your Phaser game. Then, in your games preload function, add these lines changing the parameters to suit your values:game.load.tilemap('mapName', 'assets/tilemap.json', null, Phaser.Tilemap.TILED_JSON);game.load.image('sprites', 'assets/sprites.png');Then in your create function you'll need to add these lines to create the map in the game: map = game.add.tilemap('mapName'); map.addTilesetImage('sprites', 'sprites'); layer = map.createLayer('LayerName'); layer.resizeWorld(); Make sure you pay attention to your map and layer names while making the map! Make sure your code references the correct map name and layer name. This is a common newbie error (I know because I had that problem myself ). If you need a tutorial on how to make maps in Tiled, check out this. theoutlander and Pooya72 2 Link to comment Share on other sites More sharing options...
miuan Posted May 2, 2015 Share Posted May 2, 2015 Hi there complete example with www.mapeditor.org and phaser is here : http://www.gamedevacademy.org/html5-phaser-tutorial-top-down-games-with-tiled/ hopefully will help ;-) Pooya72 1 Link to comment Share on other sites More sharing options...
Recommended Posts