mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
fixes #12 and added health
This commit is contained in:
parent
6c78c750f0
commit
d84fb20f90
7 changed files with 83 additions and 18 deletions
|
|
@ -67,7 +67,7 @@ function (Parent, PhysicsEngine, Settings, PlayerController, requestAnimFrame, N
|
|||
y: spawnPoint.y
|
||||
}
|
||||
};
|
||||
NotificationCenter.trigger("sendControlCommandToAllUsers", "gameCommand", message);
|
||||
NotificationCenter.trigger("broadcastControlCommand", "gameCommand", message);
|
||||
};
|
||||
|
||||
GameController.prototype.createPlayer = function(user) {
|
||||
|
|
@ -82,7 +82,7 @@ function (Parent, PhysicsEngine, Settings, PlayerController, requestAnimFrame, N
|
|||
var update = this.getWorldUpdateObject(false);
|
||||
|
||||
if(Object.getOwnPropertyNames(update).length > 0) {
|
||||
NotificationCenter.trigger("sendControlCommandToAllUsers", 'gameCommand', {worldUpdate:update});
|
||||
NotificationCenter.trigger("broadcastControlCommand", 'gameCommand', {worldUpdate:update});
|
||||
}
|
||||
|
||||
setTimeout(this.updateWorld.bind(this), Settings.WORLD_UPDATE_BROADCAST_INTERVAL);
|
||||
|
|
@ -138,7 +138,7 @@ function (Parent, PhysicsEngine, Settings, PlayerController, requestAnimFrame, N
|
|||
|
||||
GameController.prototype.onResetLevel = function(userId) {
|
||||
Parent.prototype.onResetLevel.call(this);
|
||||
NotificationCenter.trigger("sendControlCommandToAllUsers", "gameCommand", {resetLevel:true});
|
||||
NotificationCenter.trigger("broadcastControlCommand", "gameCommand", {resetLevel:true});
|
||||
for (var key in this.players) {
|
||||
this.spawnPlayer(this.players[key]);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue