blackbeardt Posted April 27, 2016 Share Posted April 27, 2016 Hello phaser community, I've been trying for quite some time now to just make a simple map where I can walk over and have a collision when I walk against a rock. As I dont have any errors with the direct code itself ( atleast looks like it) It doesnt seem to give me errors when it tries to load the tiled files : I rewrote my code a decent amouth of times following different guides but i seem to keep on getting this error. hopefully someone can help me Kind regards Files for the whole project : index.html phaser.js WaterfallCave.json WaterfallCave.tmx Link to comment Share on other sites More sharing options...
drhayes Posted April 28, 2016 Share Posted April 28, 2016 Your call to "addTilesetImage" is wrong. If you have two tileset images you need to add both separately. Here's what the function looks like: "addTilesetImage(tileset, key, tileWidth, tileHeight, tileMargin, tileSpacing, gid)". Let's focus on the first two arguments. You're going to end up with "mymap.addTilesetImage('tileset1');" and "mymap.addTilesetImage('tileset2');" You don't need to pass the second parameter because your image key (that you loaded in preload) is the same as the tileset key in your map's JSON (that you set in Tiled). Tom Atom 1 Link to comment Share on other sites More sharing options...
Recommended Posts