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

7 years ago by Justos

So I read the docs but Im just wondering the best way to get this done.

Wouldnt it work to have a bunch of entities to do the animation? Is it a big performance hit to have 50+ animated entities instead of background animations?

If anyone can help me with getting it set up that would be great, i dont really get how its supposed to work.

7 years ago by lTyl

If anyone can help me with getting it set up that would be great, i dont really get how its supposed to work.


The docs has a good example:
// 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 );

Your tileset image has the animated tile in the tileset, then you tell Impact to animate a starting tile ID, and pass along the frames. In the example above, your animating tiles takes up the frame from 0 to 7 in your tileset image
Page 1 of 1
« first « previous next › last »