From 38879acc99cdd14d6dc4da3cefcf64373a2b1402 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 4 Mar 2013 17:45:05 -0500 Subject: looping through states..! --- public/js/game.js | 2 +- 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; }, diff --git a/server.js b/server.js index bb21514..87a3da4 100644 --- a/server.js +++ b/server.js @@ -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(); } -- cgit v1.2.3-70-g09d2