Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

10 years ago by Lunarovich

Hello! I'm trying to animate tiles with a following code:

var starsAnim = new ig.AnimationSheet('media/stars_far.png', 16, 16);
this.backgroundAnims['media/stars_far.png'] = {
    2: new ig.Animation(starsAnim, 0.3, [6, 7, 8, 7])
};

this.loadLevel(LevelLevel1);

Tile 2 simply does not animate. Please help :)

10 years ago by Joncom

The tile count starts at 1, not 0, because 0 means no tile.

So if you weren't aware of that, then perhaps tile "2", should really be tile "3"?

10 years ago by Lunarovich

Thank you for your response. I've tried it and it does not work.

Btw, docs apparently state that you can animate even an empty map tile...

10 years ago by Joncom

Your code looks correct to me.

Just for kicks, here's a working example:
https://github.com/Joncom/impact-animated-background-map-example

Is your map layer "pre-rendered"? Because that would break the animation...

10 years ago by Lunarovich

Yeah, pre-rendering was the culprit :) Thanks!
Page 1 of 1
« first « previous next › last »