notnullgames / tiled-kaboom

Load maps made in Tiled into Kaboom!
https://notnullgames.github.io/tiled-kaboom/
20 stars 3 forks source link

tilemaps sharing a tileset #4

Open konsumer opened 3 years ago

konsumer commented 3 years ago

In Tiled, you can link to an external tileset, and share tilesets between maps. This can really cut down on filesize/request-count, if you have a bunch of maps that use the same tiles. Currently, this loader requires inline tilesets, but the code is in-place to link to external URL-base (location is used for images, and could be used for tilesets.)

When implementing, make sure inserrting an image as well as a URL (like how map works) is supported, so that users can load a tileset on their own, or link to a URL, or just load a map complete with referenced tilesets. I am a big fan of looking at looking at type of things in tilesets and determine the correct thing to do (load external tileset or use it as-is) SO it works with very little friction how the user expects, and it works similar to how map works, currently.

I could see the unpacking routine in loadTiledMap being broken-out into a separate loadTileset, so ti can be used separately, and automatically when loading a map.

Relates to #1 #2