cykod / Quintus

HTML5 Game Engine
http://html5quintus.com
GNU General Public License v2.0
1.41k stars 401 forks source link

allow loading json formatted tiled map editor files #72

Closed watsonjon closed 3 years ago

watsonjon commented 10 years ago

Quick change to allow loading json formatted files from tiled map editor.

watsonjon commented 10 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.

tuxBurner commented 10 years ago

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.

watsonjon commented 10 years ago

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!

tuxBurner commented 10 years ago

No problem i also wanted to add that i can use the layername to load it :)

watsonjon commented 10 years ago

I like that better! I just added a layerDetector function to let you specify how to determine the layer you want to load.