diff options
| author | Jules Laplace <jules@okfoc.us> | 2013-03-04 17:45:05 -0500 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2013-03-04 17:45:05 -0500 |
| commit | 38879acc99cdd14d6dc4da3cefcf64373a2b1402 (patch) | |
| tree | 9421689ba398cd8dbeba063699fc7a3bb49ff0c7 | |
| parent | bd0d666340c3660d17b538cc8fda88ce3d9f81ff (diff) | |
looping through states..!
| -rw-r--r-- | public/js/game.js | 2 | ||||
| -rw-r--r-- | server.js | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/public/js/game.js b/public/js/game.js index 78a4728..2907e2a 100644 --- a/public/js/game.js +++ b/public/js/game.js @@ -54,7 +54,7 @@ var Events = { // Game state changes state: function(data){ if (Game.state == data.state) return; - UI[ States.current ].unload(); + UI[ Game.state ].unload(); UI[ data.state ].load(data); Game.state = data.state; }, @@ -70,9 +70,9 @@ var State = { WINNING: 3, }; var Delay = { - DRAWING: 60, - VOTING: 30, - WINNING: 30, + DRAWING: 60 * 1000, + VOTING: 30 * 1000, + WINNING: 30 * 1000, } function Channel() { this.state = State.WAITING; @@ -136,7 +136,7 @@ Channel.prototype.checkState = function(){ Channel.prototype.hasEnoughPlayers = function(){ var count = 0; for (var i in this.players) { - if (++count > 2) return true; + if (++count > 1) return true; } return false; } @@ -144,7 +144,7 @@ Channel.prototype.hasEnoughPlayers = function(){ Channel.prototype.pushImage = function(image){ this.imageCount++; this.images[ image.nick ] = image; - io.sockets.emit( 'event-image', imageData ); + io.sockets.emit( 'event-image', image ); if (this.imageCount == this.playerCount) this.startVoting(); } |
