1 decade ago by paulh
Hi all
If i wanted to make a background animation play only once, how would you do that?
Basically i want the animation to play once and then either stop on a particular frame, reverse or start a new loop after x seconds.
If i wanted to make a background animation play only once, how would you do that?
// This sets two tiles (tile 0 and tile 5) of any background map with
// the 'media/tiles.png' tileset to be animated.
var as = new ig.AnimationSheet( 'media/tiles.png', 16, 16 );
this.backgroundAnims = {
'media/tiles.png': {
0: new ig.Animation( as, 0.1, [0,1,2,3,4] ),
5: new ig.Animation( as, 0.2, [5,6,7] )
}
};
this.loadLevel( MyLevel );
Basically i want the animation to play once and then either stop on a particular frame, reverse or start a new loop after x seconds.
