mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
added gangsta level and tried to fix on new level
This commit is contained in:
parent
3283f97f07
commit
0592e2524d
11 changed files with 1434 additions and 15 deletions
|
|
@ -77,6 +77,7 @@
|
|||
levelUid: gameControllerOptions.levelUid
|
||||
};
|
||||
|
||||
console.log("beginRound")
|
||||
this.broadcastControlCommand("beginRound", clientGameControllerOptions);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -214,6 +214,7 @@ function (Parent, PhysicsEngine, Settings, PlayerController, requestAnimFrame, N
|
|||
};
|
||||
|
||||
GameController.prototype.destroy = function() {
|
||||
console.log("clearTimeout")
|
||||
clearTimeout(this.animationTimeout);
|
||||
clearTimeout(this.worldUpdateTimeout);
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue