Browse Source

Draw turkey in oven

Load_Fix
Robert Chen 11 years ago
parent
commit
53a6035005
  1. 13
      js/ui.js

13
js/ui.js

@ -74,9 +74,12 @@ function OvenUI( stage, gameState ){ @@ -74,9 +74,12 @@ function OvenUI( stage, gameState ){
new createjs.Bitmap( "res/screens/KitchenScreen/TurkeyState4.svg" ),
new createjs.Bitmap( "res/screens/KitchenScreen/TurkeyState5.svg" )
];
// place turkeys in oven
for (i in turkeyStates){
turkeyStates[i].alpha = 0;
turkeyStates[i].scaleX = turkeyStates[i].scaleY = 0.2;
turkeyStates[i].x = 75;
turkeyStates[i].y = 258;
}
var temperatureText = new createjs.Text( "OFF", "40px Arial", "#ff7700" );
@ -106,6 +109,7 @@ function OvenUI( stage, gameState ){ @@ -106,6 +109,7 @@ function OvenUI( stage, gameState ){
redState.alpha = 0;
var panFront = new createjs.Bitmap( "res/screens/KitchenScreen/PanFront.png" );
panFront.alpha = 0;
this.changeTemperature = function( direction ){
@ -221,6 +225,11 @@ function OvenUI( stage, gameState ){ @@ -221,6 +225,11 @@ function OvenUI( stage, gameState ){
// did the player actually buy a turkey? if so, determine its cooked state
if( gameState.turkeyBought ){
turkeyStates[0].alpha = 1;
panFront.alpha = 1;
for(i in turkeyStates){
stage.addChild(turkeyStates[i]);
}
stage.addChild(panFront);
}
// Pan front goes here
stage.addChild( panFront );
@ -382,4 +391,4 @@ function Button( stage, gameState, x_orig, y_orig, x_dest, y_dest, eventCmd, arg @@ -382,4 +391,4 @@ function Button( stage, gameState, x_orig, y_orig, x_dest, y_dest, eventCmd, arg
button.addEventListener( "mouseover", function(){ document.body.style.cursor='pointer'; } );
button.addEventListener( "mouseout", function(){ document.body.style.cursor='default'; } );
return button;
}
}

Loading…
Cancel
Save