Nov 02 2018 12:30 PM
Hi. None of these things is actually an engine:
- Corona - Game dev SDK
- Tiled - Tool/Editor
- PonyTiled - Library/module
In any case, it isn't just a matter of using an animation in Tiled and exporting it. You need to do some coding to support that in your game.
You say 'the engine' has support for animation, but I think at that point you mean 'Tiled' has support or 'Corona' has support. I'm not sure that vanilla Ponytiled supports animations.
(I just checked and I don't see display.newSprite() anywhere in ponytiled.lua, so animations are not supported out of the box.)
You can modify PonyTiled
use Ponytiled to call builder functions instead of letting Ponytiled do all the work.
Corona + Tiled + Some Library (Ponytiled in your case) is a partial solution only. While very flexible, it won't let you do everything you want without additional work and modifications.
Edited by roaminggamer, 02 November 2018 - 01:30 PM.
I see this has changed a bit, reading now... http://docs.mapeditor.org/en/stable/manual/editing-tilesets/#tile-animation-editor
I looked at The latest Tiled animation format/output. I also looked at the source for PonyTiled, and in my best estimation you need to:
1. Modify the function: local function loadTileset(num) to detect that a tile is animated and to keep the animation data for use later.
2. Locate this code:
local image image = sheet and display.newImageRect(objectGroup, sheet, gid, object.width, object.height) or display.newImageRect(objectGroup, path and path.normalize(dir .. gid) or (dir .. gid), object.width, object.height) -- missing
modify that general section of code to add code to animate the fill based on the saved animation data from #1.
Yes, these are very general instructions, but that is the best I can offer.
You can check out how I have solved that problem using my own loader for Tiled, named Berry.
Working example : https://github.com/ldurniat/Sticker-Knight-Platformer-for-Berry
Have a nice day:)
- roaminggamer likes this