1 decade ago by coreysnyder
Below is an entity I created. I didn't get very far before realizing that the update method was not being executed on my game loop. Any idea why the init console stmts happen, but not the update?
Here's the code:
Here's the code:
ig.module(
'game.entities.enemyspawner'
)
.requires(
'impact.entity'
)
.defines(function(){
EntityEnemyspawner = ig.Entity.extend({
size: {x: 8, y: 8},
_wmDrawBox: true, // Used for adding a square to the level editor
_wmBoxColor: 'rgba(255, 0, 0 ,0.7)',
init: function( x, y, settings ) {
this.parent( x, y, settings );
console.log("ENEMY SPAWNER",settings);
},
update: function(){
console.log("Entity UPDATE");
this.parent();
}
});
});
