mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
Added spawning gameCommand logic
This commit is contained in:
parent
371592f167
commit
fb5de522e5
8 changed files with 84 additions and 59 deletions
|
|
@ -36,9 +36,7 @@ function (Engine, Level, Player) {
|
|||
}
|
||||
|
||||
GameController.prototype.userJoined = function (user) {
|
||||
var player = new Player(user.id, this.physicsEngine);
|
||||
this.players[user.id] = player;
|
||||
return player;
|
||||
this.players[user.id] = this.createPlayer(user);
|
||||
}
|
||||
|
||||
GameController.prototype.userLeft = function (user) {
|
||||
|
|
@ -47,6 +45,10 @@ function (Engine, Level, Player) {
|
|||
delete this.players[user.id];
|
||||
}
|
||||
|
||||
GameController.prototype.createPlayer = function(user) {
|
||||
return new Player(user.id, this.physicsEngine);
|
||||
};
|
||||
|
||||
|
||||
return GameController;
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue