Replacing/Swapping out hard coded platform levels with JSON files

so as the title states me and my friends are working on a game project for a class and its time sensitive. so i was wondering on how to go about changing the hard coded platform maps/levels he designed with JSON files.

now this is how he implemented the levels. ive recreated them in Tiled and exported them as JSON file. then my methodology was to basically comment our or cut our his implementations and import my JSON file. however, i keep on running into issues/Errors sometimes as soon as i preload my JSON file( i understand that it wont work till i fully implement it but the background crashes as well without me messing with it). i checked the console and get a “this.game.load is undefined”. ive looked at all tutorials out there but they cant seem to solve my issue. im new to phaser and would love some help or any direction on how i should go about doing this. let me know if more info is needed. Thanks in advance!

You’re showing a tiny part of your code and not even the part that has the JSON import, it’ll be hard for people to help you, even those familiar with Phaser. I recommend using something like Pastebin instead of showing screenshots too, so people can easily copy+paste the code to make corrections, or ctrl+F to find potential problem areas more easily.

If you haven’t already, you should ask the Phaser community for help, they can probably help out with this more. The Tiled forum has lots of people who can help with using Tiled, but there are probably not many people here with a lot of Phaser experience.

1 Like