From d7d98db072fee588a095224c5210def75213dec5 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 4 Mar 2013 18:03:56 -0500 Subject: slight delay on join/part so we don't clobber game state --- public/css/drawdrawdraw.css | 17 ++++++++++++++++- server.js | 4 ++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/public/css/drawdrawdraw.css b/public/css/drawdrawdraw.css index 6d2ed12..0a33b61 100644 --- a/public/css/drawdrawdraw.css +++ b/public/css/drawdrawdraw.css @@ -55,4 +55,19 @@ body { } #image { display: none; -} \ No newline at end of file +} + +#voting { + position: absolute; + left: 400px; + top: 50px; +} +#voting li { + list-style-type: none; +} + +#winning { + position: absolute; + left: 400px; + top: 50px; +} diff --git a/server.js b/server.js index 87a3da4..f5170c1 100644 --- a/server.js +++ b/server.js @@ -129,9 +129,9 @@ Channel.prototype.setTimeout = function( callback, delay ){ // Someone joined/left, so either start a game or stop it. Channel.prototype.checkState = function(){ if ( this.hasEnoughPlayers() ) { - if (this.state <= State.WAITING) this.startDrawing(); + if (this.state <= State.WAITING) this.setTimeout( this.startDrawing, 2000); } - else if (this.state > State.WAITING) this.startWaiting(); + else if (this.state > State.WAITING) this.setTimeout( this.startWaiting, 2000); } Channel.prototype.hasEnoughPlayers = function(){ var count = 0; -- cgit v1.2.3-70-g09d2