MatisiekPL Posted August 2, 2016 Share Posted August 2, 2016 Hello, I have a problem with loading JSON file on my game to make a world. This is a files: https://www.sendspace.com/file/icmjbs What is the problem??? How to fix this problem? Link to comment Share on other sites More sharing options...
Clem Posted August 2, 2016 Share Posted August 2, 2016 Can you give us more information? What is your "problem" exactly ? Link to comment Share on other sites More sharing options...
MatisiekPL Posted August 2, 2016 Author Share Posted August 2, 2016 The map isn't showing. I'm sorry for my English. I'm from Poland PS. Maybe JSON file is broked??? Link to comment Share on other sites More sharing options...
Clem Posted August 3, 2016 Share Posted August 3, 2016 Okay, I got it working, here is what I've found: - You have to remove the 'game.add.sprite(0, 0, 'Tiles');' line 21, because it is showing on the screen your tileset and it makes no sense - Line 34 you are trying to load a layer that doesn't exist, the only layer in your json file is called 'Main', and not 'World1' - Moreover, your layer 'Main', has the same name as the map itself 'Main', what you should do is to rename your map "MainMap" for example (only change the name line 13 and line 29) and rename the layer "MainLayer" (don't forget to change the name in your Tile Editor AND line 34) - Last thing, your map is saved with a base64 format, but what you need to do is to saved it in a CSV format. This way, it can be read by Phaser. Now it's working fine MatisiekPL 1 Link to comment Share on other sites More sharing options...
MatisiekPL Posted August 3, 2016 Author Share Posted August 3, 2016 Can you send me ready files??? Link to comment Share on other sites More sharing options...
Clem Posted August 4, 2016 Share Posted August 4, 2016 Well, you just have to modify your index.html file with the changes listed above, and then in your map editor change the name of the layer and export the map in the CSV format. Link to comment Share on other sites More sharing options...
Recommended Posts