Hello everyone, this is the first time I try to import shapes of objects in Corona SDK, I am using Tile Collision Editor Tool from Tiled Map Editor, but I can’t get it to work. can you help me?
This is the sample code from: https://github.com/ldurniat/Tiled-Collision-Editor-Plugin
I import the maps like this:
local filename = event.params.map or "scene / game / map / sandbox.json" local mapData = json.decodeFile (system.pathForFile (filename, system.ResourceDirectory)) map = tiled.new (mapData, "scene / game / map")
The monster image imported it like this, but it does not interact with the scene, it falls and is lost:
local physicalData = tiledCollisionEditor.getPhysicalData ("scene.game.map.monster") -- Create monster image local monster = display.newImage ("scene / game / map / monster.png", 150, 300) monster.x = 1200 monster.y = display.screenOriginY + 125 physics.addBody (monster, "dynamic", unpack (physicalData.Objects ["monster.png"]))