I find Event and the Communication page in script manual has merged ~
And when using code like
playerEntity.script.player.jump();
the function cannot access instance local data like
// initialize code called once per entity
player.prototype.initialize = function() {
// local rotation or world rotation
this.local = false;
};
player.prototype.jump = function(){
consle.log(this.local); //undefined when calling by playerEntity.script.player.jump();
};
So, if Event is the only way. Is there any pattern can be reference ?
I’m currently using Events like:
this.app.fire(this.entity.name + ':player:jump');
Is this a good practice ?