Jump to content

Loading Tiled map problems


blackbeardt
 Share

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 :

index.html

phaser.js

Prof.png

tileset.png

tileset2.png

WaterfallCave.json

WaterfallCave.tmx

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

 Share

  • Recently Browsing   0 members

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