|
|
|
@ -310,27 +310,27 @@ function OvenUI( stage, gameState ){
@@ -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(){ |
|
|
|
|