mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
new system for synchronizing game objects. fixes #74
This commit is contained in:
parent
3ef3a6abf9
commit
07dad646cf
19 changed files with 194 additions and 162 deletions
|
|
@ -27,8 +27,6 @@ function (Doll, Settings, Nc, Exception, ColorConverter, SpectatorDoll, RubeDoll
|
|||
this.spawned = false;
|
||||
this.holdingItem = null;
|
||||
this.spectatorDoll = new SpectatorDoll(this.physicsEngine, "spectatorDoll-" + this.id, this);
|
||||
|
||||
Nc.trigger(Nc.ns.core.game.gameObject.add, 'animated', this);
|
||||
}
|
||||
|
||||
Player.prototype.getNickname = function() {
|
||||
|
|
@ -161,7 +159,7 @@ function (Doll, Settings, Nc, Exception, ColorConverter, SpectatorDoll, RubeDoll
|
|||
|
||||
Player.prototype.destroy = function () {
|
||||
|
||||
Nc.trigger(Nc.ns.core.game.gameObject.remove, 'animated', this);
|
||||
// FIXME add destroy nc hook
|
||||
|
||||
if(this.holdingItem) {
|
||||
var options = {
|
||||
|
|
@ -174,8 +172,10 @@ function (Doll, Settings, Nc, Exception, ColorConverter, SpectatorDoll, RubeDoll
|
|||
|
||||
this.spectatorDoll.destroy();
|
||||
|
||||
// doll destoys itself at the end cause its a gameobject
|
||||
// but on userLeft, the player has to destroy it.
|
||||
if(this.doll) {
|
||||
this.doll.destroy();
|
||||
this.doll.destroy();
|
||||
}
|
||||
|
||||
if(this.playerController) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue