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.
The .addAnim() method have 4 parameters, but the constructor have 3 parameters. Why did you say "takes the same parameters"? How to understand it?
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?