1 decade ago by davidx
Hi,
I was implementing a spawned animation (copying how it is in the YOSS game) and I get the following error:
I looked at the YOSS source and ran that and it also throws this error. If I make the animation sheet smaller, the error goes away but then the animation is too small.
Here is the verbatum from explosion.js from the YOSS game. Anyone have any pointers?
Thanks,
I was implementing a spawned animation (copying how it is in the YOSS game) and I get the following error:
Uncaught Error: INDEX_SIZE_ERR: DOM Exception 1 ig.Image.ig.Class.extend.drawTileimage.js:154 ig.Animation.ig.Class.extend.drawanimation.js:100 ig.Entity.ig.Class.extend.drawentity.js:131 ig.Game.ig.Class.extend.drawgame.js:186 MyGame.ig.Game.extend.drawmain.js:100 window.ig.Class.extend.prototypeimpact.js:384 ig.Game.ig.Class.extend.rungame.js:130 ig.System.ig.Class.extend.runsystem.js:101 (anonymous function)impact.js:52
I looked at the YOSS source and ran that and it also throws this error. If I make the animation sheet smaller, the error goes away but then the animation is too small.
Here is the verbatum from explosion.js from the YOSS game. Anyone have any pointers?
ig.module( 'game.entities.explosion' ) .requires( 'impact.entity' ) .defines(function(){ EntityExplosion = ig.Entity.extend({ size: {x: 48, y: 48}, type: ig.Entity.TYPE.NONE, collides: ig.Entity.COLLIDES.NEVER, animSheet: new ig.AnimationSheet( 'media/Explode5-m.png', 48, 48), init: function( x, y, settings ) { //Received the coordinates of the center of the creating entity. //Subtract half of the size of the explosion from these numbers //in order to center the explosion on top of the entity. x = x - (this.size.x/2); y = y - (this.size.y/2); this.parent( x, y, settings ); //We only want the explosion animation to loop once so stop is true. this.addAnim( 'idle', 0.05, [0,1,2,3,4,5,6,7], true ); //Start timer so this entity can be killed after 0.5 seconds. this.timer = new ig.Timer(0.5); }, update: function(){ //If it has been more than 0.5 seconds then kill this explosion entity. if (this.timer.delta() > 0) { this.kill(); } this.parent(); }, }); });
Thanks,