Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Animation ponytiled
Started by AkioSarkiz Nov 02 2018 12:30 PM

5 replies to this topic
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

AkioSarkiz

[GLOBAL: userInfoPane.html]
AkioSarkiz
  • Observer

  • 22 posts
  • Corona SDK

Hello.
I started to use the "ponytiled" engine quite recently. And I had a problem. The engine has support for animation, but it is not said how to implement it. Can you tell me how to make the animation in tiled?


[TOPIC: post.html]
#2

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,286 posts
  • Corona SDK

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.)

 

Source code (raw): https://raw.githubusercontent.com/ponywolf/ponytiled/master/com/ponywolf/ponytiled.lua

 

You can modify PonyTiled

 

and/or

 

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.


[TOPIC: post.html]
#3

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,286 posts
  • Corona SDK

Out of curiousity, Are you editing animations as is shown in this video, at time 15:18 +



[TOPIC: post.html]
#4

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,286 posts
  • Corona SDK

I see this has changed a bit, reading now... http://docs.mapeditor.org/en/stable/manual/editing-tilesets/#tile-animation-editor



[TOPIC: post.html]
#5

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,286 posts
  • Corona SDK

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.  :(



[TOPIC: post.html]
#6

ldurniat

[GLOBAL: userInfoPane.html]
ldurniat
  • Contributor

  • 365 posts
  • Corona SDK

Hi @AkioSarkiz,

 

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:)

 

ldurniat


  • roaminggamer likes this


[topic_controls]
[/topic_controls]