From aa0cbae444de6e85115b39c4eadf2ddee9e350fc Mon Sep 17 00:00:00 2001 From: Robert Chen Date: Fri, 29 Nov 2013 15:39:53 -0800 Subject: [PATCH] 10 seconds --- js/ui.js | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/js/ui.js b/js/ui.js index 4d115db..1c17a28 100644 --- a/js/ui.js +++ b/js/ui.js @@ -310,27 +310,27 @@ function OvenUI( stage, gameState ){ tick: function(){ // IMPORTANT: SECOND TIMER var diff = Date.now() - gameState.oldTime; - if( diff > 1000 ){ + if( diff > 10000 ){ gameState.oldTime = Date.now(); that.secondTick( diff ); console.log(new Date( gameState.currentTime) ); - if( gameState.turkeyBought ){ - - // what's the state of the turkey - turkeyState = ovenModel.getTurkeyState(); - turkeyStates[0].alpha = 1; - if( turkeyState["skin"]["cond"][0] == "Undercooked" ) - turkeyStates[1].alpha = turkeyState["skin"]["cond"][1]; - if( turkeyState["skin"]["cond"][0] == "Cooked" ) - turkeyStates[2].alpha = turkeyState["skin"]["cond"][1]; - if( turkeyState["skin"]["cond"][0] == "Dry" ) - turkeyStates[3].alpha = turkeyState["skin"]["cond"][1]; - if( turkeyState["skin"]["cond"][0] == "Charcoal" ) - turkeyStates[4].alpha = turkeyState["skin"]["cond"][1]; - if( turkeyState["skin"]["cond"][0] == "House Fire" ) - turkeyStates[4].alpha = 1; - } + if( gameState.turkeyBought ){ + + // what's the state of the turkey + turkeyState = ovenModel.getTurkeyState(); + turkeyStates[0].alpha = 1; + if( turkeyState["skin"]["cond"][0] == "Undercooked" ) + turkeyStates[1].alpha = turkeyState["skin"]["cond"][1]; + if( turkeyState["skin"]["cond"][0] == "Cooked" ) + turkeyStates[2].alpha = turkeyState["skin"]["cond"][1]; + if( turkeyState["skin"]["cond"][0] == "Dry" ) + turkeyStates[3].alpha = turkeyState["skin"]["cond"][1]; + if( turkeyState["skin"]["cond"][0] == "Charcoal" ) + turkeyStates[4].alpha = turkeyState["skin"]["cond"][1]; + if( turkeyState["skin"]["cond"][0] == "House Fire" ) + turkeyStates[4].alpha = 1; + } } }, render: function(){