summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--public/js/game.js2
-rw-r--r--server.js10
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();
}