Jump to content

Phaser incorrectly loads Tiled tilemap


lancepants42
 Share

Recommended Posts

This is my first time using both Phaser and Tiled, and it's not going well. When I load my tilemap via:

function preload(){
	game.load.tilemap('overworld','assets/maps/testmap.json',null, Phaser.Tilemap.TILED_JSON)
	game.load.image('tiles','assets/maps/testmap.png')

}
function create(){
	var map = game.add.tilemap("overworld")
	map.addTilesetImage("Dungeon","tiles")
	var layer = map.createLayer('Ground');
    var terrain = map.createLayer('Terrain');
	game.layer.resizeWorld();


}

Instead of what I see in Tiled:

Screenshot 2016-07-15 18.13.36.png

I see:

Screenshot 2016-07-15 18.14.41.png

 

It's hard to tell here, but the dirt stone water etc tiles are all displayed as different grasses. So I tried to do some debugging and made a custom tileset to see exactly how it was going wrong.

Here's how it looks in Tiled:

Screenshot 2016-07-15 18.17.05.png

and here's how it's rendered by Phaser (with a background color set):

Screenshot 2016-07-15 18.18.21.png

As you can see, it's supposed to be 00-09 repeating on the first row, 10-19 repeating on the second etc, but instead displays the first row 5 times and then the second, then back to the first. I don't understand what's going wrong, especially because it's breaking inconsistently using different maps.

 

Any help or insight would be GREATLY appreciated!

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...