Browse Source

10 seconds

Load_Fix
Robert Chen 11 years ago
parent
commit
aa0cbae444
  1. 34
      js/ui.js

34
js/ui.js

@ -310,27 +310,27 @@ function OvenUI( stage, gameState ){
tick: function(){ tick: function(){
// IMPORTANT: SECOND TIMER // IMPORTANT: SECOND TIMER
var diff = Date.now() - gameState.oldTime; var diff = Date.now() - gameState.oldTime;
if( diff > 1000 ){ if( diff > 10000 ){
gameState.oldTime = Date.now(); gameState.oldTime = Date.now();
that.secondTick( diff ); that.secondTick( diff );
console.log(new Date( gameState.currentTime) ); console.log(new Date( gameState.currentTime) );
if( gameState.turkeyBought ){ if( gameState.turkeyBought ){
// what's the state of the turkey // what's the state of the turkey
turkeyState = ovenModel.getTurkeyState(); turkeyState = ovenModel.getTurkeyState();
turkeyStates[0].alpha = 1; turkeyStates[0].alpha = 1;
if( turkeyState["skin"]["cond"][0] == "Undercooked" ) if( turkeyState["skin"]["cond"][0] == "Undercooked" )
turkeyStates[1].alpha = turkeyState["skin"]["cond"][1]; turkeyStates[1].alpha = turkeyState["skin"]["cond"][1];
if( turkeyState["skin"]["cond"][0] == "Cooked" ) if( turkeyState["skin"]["cond"][0] == "Cooked" )
turkeyStates[2].alpha = turkeyState["skin"]["cond"][1]; turkeyStates[2].alpha = turkeyState["skin"]["cond"][1];
if( turkeyState["skin"]["cond"][0] == "Dry" ) if( turkeyState["skin"]["cond"][0] == "Dry" )
turkeyStates[3].alpha = turkeyState["skin"]["cond"][1]; turkeyStates[3].alpha = turkeyState["skin"]["cond"][1];
if( turkeyState["skin"]["cond"][0] == "Charcoal" ) if( turkeyState["skin"]["cond"][0] == "Charcoal" )
turkeyStates[4].alpha = turkeyState["skin"]["cond"][1]; turkeyStates[4].alpha = turkeyState["skin"]["cond"][1];
if( turkeyState["skin"]["cond"][0] == "House Fire" ) if( turkeyState["skin"]["cond"][0] == "House Fire" )
turkeyStates[4].alpha = 1; turkeyStates[4].alpha = 1;
} }
} }
}, },
render: function(){ render: function(){

Loading…
Cancel
Save