1 decade ago by coreysnyder
Here's my Entity:
I want this star entity to be drawn to the screen. So in my games init function I call:
I see the log on INIT but not on draw, update, or kill. And I don't see this item drawn to the screen. Any ideas what I'm overlooking?
ig.module( 'game.entities.AnimateStar' ) .requires( 'impact.entity' ) .defines(function(){ EntityAnimateStar = ig.Entity.extend({ animSheet: new ig.AnimationSheet("media/web/star.png", 35, 35), size: {x:35, y:35}, offset: {x: 0, y:0}, gravityFactor : 0, // wont fall due to gravity _wmIgnore: true, init: function(x, y, settings){ this.parent(x, y, settings); console.log("INIT: EntityAnimateStar"); this.addAnim('idle', 1, [0]); }, update: function(){ console.log("UPDATE"); this.parent(); }, kill: function(){ console.log("KILL"); this.parent(); }, draw: function(){ console.log("draw"); this.parent(); } }); });
I want this star entity to be drawn to the screen. So in my games init function I call:
ig.game.spawnEntity( EntityAnimateStar, 40, 30, {order: 1} )
I see the log on INIT but not on draw, update, or kill. And I don't see this item drawn to the screen. Any ideas what I'm overlooking?