mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 18:47:35 +00:00
parent
8b8093b771
commit
8641a2dc0b
4 changed files with 36 additions and 21 deletions
|
|
@ -13,7 +13,9 @@ function (Parent, Settings, Nc, Layer) {
|
|||
this.layerId = Layer.ID.ITEM;
|
||||
Parent.call(this, physicsEngine, uid, options);
|
||||
|
||||
Nc.on(Nc.ns.client.game.events.render, this.render, this);
|
||||
this.ncTokens = this.ncTokens.concat([
|
||||
Nc.on(Nc.ns.client.game.events.render, this.render, this)
|
||||
]);
|
||||
}
|
||||
|
||||
Item.prototype = Object.create(Parent.prototype);
|
||||
|
|
|
|||
|
|
@ -16,7 +16,9 @@ function (Parent, Nc, Settings) {
|
|||
this.healthBarViewVisible = false;
|
||||
this.initHealthBar();
|
||||
|
||||
Nc.on(Nc.ns.client.game.events.render, this.render, this);
|
||||
this.ncTokens = [
|
||||
Nc.on(Nc.ns.client.game.events.render, this.render, this)
|
||||
];
|
||||
}
|
||||
|
||||
Player.prototype = Object.create(Parent.prototype);
|
||||
|
|
@ -109,6 +111,7 @@ function (Parent, Nc, Settings) {
|
|||
Player.prototype.destroy = function() {
|
||||
clearTimeout(this.healthBarViewVisibleTimeout);
|
||||
Nc.trigger(Nc.ns.client.view.healthBar.remove, this.healthBarView);
|
||||
Nc.off(this.ncTokens);
|
||||
Parent.prototype.destroy.call(this);
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue