added gangsta level and tried to fix on new level

This commit is contained in:
Jeena 2015-04-12 18:08:11 +02:00
parent 3283f97f07
commit 0592e2524d
11 changed files with 1434 additions and 15 deletions

View file

@ -77,6 +77,7 @@
levelUid: gameControllerOptions.levelUid
};
console.log("beginRound")
this.broadcastControlCommand("beginRound", clientGameControllerOptions);
};

View file

@ -214,6 +214,7 @@ function (Parent, PhysicsEngine, Settings, PlayerController, requestAnimFrame, N
};
GameController.prototype.destroy = function() {
console.log("clearTimeout")
clearTimeout(this.animationTimeout);
clearTimeout(this.worldUpdateTimeout);

View file

@ -74,8 +74,9 @@ function (Parent, Item, Box2D, Nc, Assert) {
// * 80: tested imperically by throwing knife fast
var damage = (velocityDamage + 0.5) * (weightDamage * 300 + dangerDamage * 80) / 2;
var lastMovedPlayer = item.lastMoved.player;
var callback = function() {
self.player.addDamage(damage, item.lastMoved.player, item);
self.player.addDamage(damage, lastMovedPlayer, item);
};
Nc.trigger(Nc.ns.channel.engine.worldQueue.add, callback);

View file

@ -68,8 +68,6 @@ function (Parent, Nc) {
if(this.stats.health <= 0) {
if(enemy != this) enemy.score();
this.kill(enemy, byItem);
} else {
this.broadcastStats();
}
this.broadcastStats();
@ -86,7 +84,6 @@ function (Parent, Nc) {
var ragDollId = this.stats.deaths;
Parent.prototype.kill.call(this, killedByPlayer, ragDollId);
this.broadcastStats();
Nc.trigger(Nc.ns.channel.to.client.gameCommand.broadcast, "playerKill", {
playerId: this.id,
killedByPlayerId: killedByPlayer.id,
@ -103,7 +100,6 @@ function (Parent, Nc) {
Player.prototype.score = function() {
this.stats.score++;
this.broadcastStats();
};
Player.prototype.broadcastStats = function() {