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

1 decade ago by kilofox

The .addAnim() method takes the same parameters like the constructor for Animations, except that it always uses the .animSheet as the AnimationSheet.

EntityBlob = ig.Entity.extend({    
    // Load an animation sheet
    animSheet: new ig.AnimationSheet( 'blob.png', 16, 16 ),
    init: function( x, y, settings ) {
        // Add animations for the animation sheet
        this.addAnim( 'idle', 1.5, [1,1,2] );
        this.addAnim( 'jump', 0.2, [2,3,4], true );
        // Call the parent constructor
        this.parent( x, y, settings );
    }
});

The .addAnim() method have 4 parameters, but the constructor have 3 parameters. Why did you say "takes the same parameters"? How to understand it?

1 decade ago by kilofox

Sorry. I see - the constructor for Animations.
Page 1 of 1
« first « previous next › last »