Tilengine - The 2D retro graphics engine forum
Tiled animation plays strange - Printable Version

+- Tilengine - The 2D retro graphics engine forum (http://tilengine.org/forum)
+-- Forum: English forums (http://tilengine.org/forum/forumdisplay.php?fid=3)
+--- Forum: Support (http://tilengine.org/forum/forumdisplay.php?fid=7)
+--- Thread: Tiled animation plays strange (/showthread.php?tid=576)



Tiled animation plays strange - mycats - 05-06-2020

       
Some animation frames are not displayed in Tilengine window.
Here is animation in Tiled and in TLN window.


RE: Tiled animation plays strange - megamarc - 05-06-2020

Hi
I think this is due to a limitation present prior to current release 2.8.0: an animated tile couldn't have one of the frames being the tile itself, because that frame was overwritten and get lost. This limitation has been addressed in release 2.8.0. Can you test it with latest version and confirm that it doesn't happen anymore?


RE: Tiled animation plays strange - mycats - 05-06-2020

Thanks, it works!
   


RE: Tiled animation plays strange - megamarc - 05-07-2020

Thanks for the feedback!


RE: Tiled animation plays strange - mycats - 05-07-2020

   
Hi. After newest update background layer animations are played on foreground layer, and I am getting smth like this after adding background animations.


RE: Tiled animation plays strange - megamarc - 05-07-2020

Hi again,
Could you please upload the assets that are showing this problem?


RE: Tiled animation plays strange - mycats - 05-07-2020

Code:
void InitScrambledEgg()
{
    TLN_SetLoadPath("data/scrambledegg");
    TLN_SetRasterCallback(NULL);
    foreground_tilemap = TLN_LoadTilemap("scrambledegg.tmx",NULL);
    background_tilemap = TLN_LoadTilemap("scrambledegg_background.tmx",NULL);
    TLN_SetLayer(LAYER_FOREGROUND,NULL,foreground_tilemap);
    TLN_SetLayer(LAYER_BACKGROUND,NULL,background_tilemap);
    TLN_SetBGColor(0,0,0);
    TLN_SetLayerPosition(LAYER_FOREGROUND,0,HEIGHT*-1);
    TLN_SetLayerPosition(LAYER_BACKGROUND,0,HEIGHT*-1);
    sonic_xpos=65;
    sonic_ypos=193;
    SetSonicSpritePosition();
}

It doesn't happen on versions older than 2.8.0


RE: Tiled animation plays strange - megamarc - 05-08-2020

Yes you're right. It seems that the animation in one layer (background) is being applied in another one (foreground). I'll debug this and publish a fix as soon as I can.
Thanks for pointing out this issue


RE: Tiled animation plays strange - megamarc - 05-09-2020

Fixed. I pushed update 2.8.1 to GitHub with the fix. Here you can see an animated gif on how should look now your sample, both layers are showing correct animated tiles.