When importing maps from Tiled, how can I get collisions to work with the collision shapes I’ve defined in the Tiled Map Editor?
I’ve had a hard time finding clear information about this. The only thing I’ve come across is an auto-generated collision feature, but it seems too complex for a simple pixel game.
Would I need to import my maps in Lua instead and write a custom importer that reads the collision data from the Tiled file?
You’ll need to write some code to read the Tiled object layer data and spawn collision objects in Defold
Many developers use Tiled for visual layout and rough collision placement, then use a script to generate the actual Defold collision objects at runtime or in the editor
What works well:
Use Tiled’s object layers to mark where collisions should be
Export to Lua or JSON format
Parse this data in Defold to create collision objects programmatically