begin Round Bug improvements, player renders doll. fixes #64

This commit is contained in:
logsol 2014-05-24 17:39:19 +02:00
parent 55b56f9c12
commit c18384f502
11 changed files with 76 additions and 42 deletions

View file

@ -99,7 +99,7 @@ function (Doll, Settings, Nc, Exception, SpectatorDoll, RagDoll) {
this.throw(0, 0, this.holdingItem)
}
// get forces
// prepare for creating the ragdoll
var options = {
x: this.getPosition().x * Settings.RATIO,
y: this.getPosition().y * Settings.RATIO,
@ -123,9 +123,6 @@ function (Doll, Settings, Nc, Exception, SpectatorDoll, RagDoll) {
this.doll = null;
this.ragDoll = ragDoll;
Nc.trigger(Nc.ns.core.game.player.killed, this, killedByPlayer);
};
Player.prototype.update = function () {
@ -145,9 +142,14 @@ function (Doll, Settings, Nc, Exception, SpectatorDoll, RagDoll) {
}
this.spectatorDoll.destroy();
if(this.doll) this.doll.destroy();
this.playerController.destroy();
if(this.doll) {
this.doll.destroy();
}
if(this.playerController) {
this.playerController.destroy();
}
}
Player.prototype.setPlayerController = function(playerController) {