1 decade ago by fulvio
I am trying to access the following player property inside an Entity however I'm receiving an undefined error.
This is how I&
Then inside the Entity I'm calling:
This is how I&
039;ve defined #player within main.js :
MyGame = ig.Game.extend({
player: null,
update: function() {
this.player = this.getEntitiesByType( EntityPlayer )[0];
if (this.player) {
//etc
}
}
});
Then inside the Entity I'm calling:
ig.game.player.pos.x and I get ig.game.player is undefined 