Closed watsonjon closed 3 years ago
Great! I saw there was already an xml loader so I just followed suit. It definitely needs to be refactored so glad to hear you are doing that.
Hi i already wrote something to load Tiled json files because they are 1/4 of the size as a corresponding xml file. See https://gist.github.com/tuxBurner/8085829, sorry it is a bit messy, because it handles some stuff for my game, but it is working.
I moved the loading into a subclass since each map & layer will have some custom things associated to it. Now we can add all kinds of things to this subclass and load as needed.
Just saw what @tuxBurner had and it is the same idea, sorry didn't see that before!
No problem i also wanted to add that i can use the layername to load it :)
I like that better! I just added a layerDetector function to let you specify how to determine the layer you want to load.
Quick change to allow loading json formatted files from tiled map editor.