Jump to content

Loading Tiled map problems


Recommended Posts

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 :   d4de125d2d.png

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 :








Link to comment
Share on other sites

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).

Link to comment
Share on other sites


  • Recently Browsing   0 members

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