mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
fixing up the branch
This commit is contained in:
parent
005fb57c31
commit
76391c2c5e
6 changed files with 19 additions and 11 deletions
|
|
@ -8,9 +8,8 @@ function(GameController, NotificationCenter) {
|
|||
function Channel(name) {
|
||||
this.name = name;
|
||||
this.users = {};
|
||||
this.serverGame = new GameController();
|
||||
console.log("server game " + this.serverGame);
|
||||
this.serverGame.loadLevel("default.json");
|
||||
this.gameController = new GameController();
|
||||
this.gameController.loadLevel("default.json");
|
||||
|
||||
var self = this;
|
||||
NotificationCenter.on("processGameCommandFromUser", function(topic, args) {
|
||||
|
|
@ -30,11 +29,11 @@ function(GameController, NotificationCenter) {
|
|||
user.sendCommand('joinSuccess', {channelName: this.name, id: user.id, userIds: userIds});
|
||||
this.sendCommandToAllUsersExcept('userJoined', user.id, user);
|
||||
|
||||
this.serverGame.createPlayerForUser(user)
|
||||
this.gameController.createPlayerForUser(user)
|
||||
}
|
||||
|
||||
Channel.prototype.releaseUser = function(user) {
|
||||
this.serverGame.userIdLeft(user.id);
|
||||
this.gameController.userIdLeft(user.id);
|
||||
|
||||
this.sendCommandToAllUsersExcept("userLeft", user.id, user);
|
||||
delete this.users[user.id];
|
||||
|
|
@ -55,7 +54,7 @@ function(GameController, NotificationCenter) {
|
|||
}
|
||||
|
||||
Channel.prototype.processGameCommandFromUser = function(command, options, user) {
|
||||
this.serverGame.progressGameCommandFromUser(command, options, user);
|
||||
this.gameController.progressGameCommandFromUser(command, options, user);
|
||||
}
|
||||
|
||||
return Channel;
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ define([
|
|||
function(Parent, PhysicsEngine, Settings, InputController, requestAnimFrame, NotificationCenter) {
|
||||
|
||||
function GameController () {
|
||||
Parent.apply(this, new PhysicsEngine());
|
||||
Parent.call(this, new PhysicsEngine());
|
||||
|
||||
this.inputControllers = {};
|
||||
|
||||
|
|
@ -18,6 +18,9 @@ function(Parent, PhysicsEngine, Settings, InputController, requestAnimFrame, Not
|
|||
this.updateWorld();
|
||||
}
|
||||
|
||||
GameController.prototype = Object.create(Parent.prototype);
|
||||
console.log(GameController.loadLevel);
|
||||
|
||||
GameController.prototype.update = function() {
|
||||
|
||||
requestAnimFrame(this.update.bind(this));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue