diff --git a/js/dialogue.js b/js/dialogue.js
index 44dc0f2..f480e42 100644
--- a/js/dialogue.js
+++ b/js/dialogue.js
@@ -86,12 +86,12 @@ function DialogUI( stage, gameState ){
if( that.dialogState == DIALOG_RECEDING ){
that.dialogBox.y+=that.dialogSpeed;
that.textContent.y +=that.dialogSpeed;
- console.log( "Receding" + that.dialogBox.y );
+ //console.log( "Receding" + that.dialogBox.y );
}
if( that.dialogState == DIALOG_SHOWING ){
that.dialogBox.y-=that.dialogSpeed;
that.textContent.y -=that.dialogSpeed;
- console.log( "Advancing" + that.dialogBox.y );
+ //console.log( "Advancing" + that.dialogBox.y );
}
// toggle states
@@ -99,14 +99,14 @@ function DialogUI( stage, gameState ){
that.dialogBox.y = 675;
that.textContent.y = 735;
that.dialogState = DIALOG_PAUSING;
- console.log( "Pausing on recede" + that.dialogBox.y );
+ //console.log( "Pausing on recede" + that.dialogBox.y );
}
if( that.dialogBox.y < 435 && that.dialogState == DIALOG_SHOWING ){
that.dialogBox.y = 435;
that.textContent.y = 480;
that.dialogState = DIALOG_PAUSING;
- console.log( "Pausing on showing" + that.dialogBox.y );
+ //console.log( "Pausing on showing" + that.dialogBox.y );
}
/* next states if there are any on the queue */
diff --git a/js/main.js b/js/main.js
index 8d99a98..5b3188a 100644
--- a/js/main.js
+++ b/js/main.js
@@ -7,8 +7,8 @@ function GameState(){
this.oldTime = new Date().getTime();
this.name = "";
- this.gender = "";
- this.wallet = 1000;
+ this.gender = "Male";
+ this.wallet = 40.00;
// Load all our resources:
var queue = new createjs.LoadQueue(true);
@@ -31,6 +31,11 @@ function GameState(){
queue.loadFile( {id:"res/screens/LoadingScreen/Turkey75.png", src: "res/screens/LoadingScreen/Turkey75.png"} );
queue.loadFile( {id:"res/screens/LoadingScreen/TurkeyDone.png", src: "res/screens/LoadingScreen/TurkeyDone.png"} );*/
+ // Screens
+ queue.loadFile( {id: "res/screens/DifficultyScreen/Difficulty-Selection.png", src:"res/screens/DifficultyScreen/Difficulty-Selection.png"} );
+ queue.loadFile( {id: "res/screens/DifficultyScreen/ButtonMale.png", src:"res/screens/DifficultyScreen/ButtonMale.png"} );
+ queue.loadFile( {id: "res/screens/DifficultyScreen/ButtonFemale.png", src:"res/screens/DifficultyScreen/ButtonFemale.png"} );
+
//queue.addEventListener("fileload", handleFileComplete);
// Load image assets
queue.loadFile( {id: "TurkeySpriteFile", src:"res/screens/MainScreen/TurkeySprite.png"} );
@@ -53,11 +58,59 @@ function GameState(){
queue.loadFile( {id: "UIClickFile", src:"res/sound/GUI/click.mp3"} );
queue.loadFile( {id: "UIBuzzFile", src:"res/sound/GUI/buzz.mp3"} );
-
+ // Kitchen Items
+ queue.loadFile( {id: "res/screens/KitchenScreen/TurkeyState1.svg", src:"res/screens/KitchenScreen/TurkeyState1.svg"});
+ queue.loadFile( {id: "res/screens/KitchenScreen/TurkeyState2.svg", src:"res/screens/KitchenScreen/TurkeyState2.svg"});
+ queue.loadFile( {id: "res/screens/KitchenScreen/TurkeyState3.svg", src:"res/screens/KitchenScreen/TurkeyState3.svg"});
+ queue.loadFile( {id: "res/screens/KitchenScreen/TurkeyState4.svg", src:"res/screens/KitchenScreen/TurkeyState4.svg"});
+ queue.loadFile( {id: "res/screens/KitchenScreen/TurkeyState5.svg", src:"res/screens/KitchenScreen/TurkeyState5.svg"});
+
+ queue.loadFile( {id: "res/screens/KitchenScreen/TempProbeKitchenGlow.png", src:"res/screens/KitchenScreen/TempProbeKitchenGlow.png"});
+ queue.loadFile( {id: "res/screens/KitchenScreen/TempProbeKitchen.png", src:"res/screens/KitchenScreen/TempProbeKitchen.png"});
+
+ queue.loadFile( {id: "res/screens/KitchenScreen/StuffingSpecialKitchenGlow.png", src:"res/screens/KitchenScreen/StuffingSpecialKitchenGlow.png"});
+ queue.loadFile( {id: "res/screens/KitchenScreen/StuffingSpecialKitchen.png", src:"res/screens/KitchenScreen/StuffingSpecialKitchen.png"});
+
+ queue.loadFile( {id: "res/screens/KitchenScreen/StuffingRepurposedKitchenGlow.png", src:"res/screens/KitchenScreen/StuffingRepurposedKitchenGlow.png"});
+ queue.loadFile( {id: "res/screens/KitchenScreen/StuffingRepurposedKitchen.png", src:"res/screens/KitchenScreen/StuffingRepurposedKitchen.png"});
+
+ queue.loadFile( {id: "res/screens/KitchenScreen/StuffingExquisiteKitchenGlow.png", src:"res/screens/KitchenScreen/StuffingExquisiteKitchenGlow.png"});
+ queue.loadFile( {id: "res/screens/KitchenScreen/StuffingExquisiteKitchen.png", src:"res/screens/KitchenScreen/StuffingExquisiteKitchen.png"});
+
+ queue.loadFile( {id: "res/screens/KitchenScreen/StoreBrochureGlow.png", src:"res/screens/KitchenScreen/StoreBrochureGlow.png"});
+ queue.loadFile( {id: "res/screens/KitchenScreen/StoreBrochure.png", src:"res/screens/KitchenScreen/StoreBrochure.png"});
+
+ queue.loadFile( {id: "res/screens/KitchenScreen/FrillsBoxKitchenGlow.png", src:"res/screens/KitchenScreen/FrillsBoxKitchenGlow.png"});
+ queue.loadFile( {id: "res/screens/KitchenScreen/FrillsBoxKitchen.png", src:"res/screens/KitchenScreen/FrillsBoxKitchen.png"});
+
+ queue.loadFile( {id: "res/screens/KitchenScreen/DoorPeekLightOn.png", src:"res/screens/KitchenScreen/DoorPeekLightOn.png"});
+ queue.loadFile( {id: "res/screens/KitchenScreen/DoorPeekLightOff.png", src:"res/screens/KitchenScreen/DoorPeekLightOff.png"});
+
+ queue.loadFile( {id: "res/screens/KitchenScreen/DoorOpen.png", src:"res/screens/KitchenScreen/DoorOpen.png"});
+ queue.loadFile( {id: "res/screens/KitchenScreen/DoorClosedLightOn.png", src:"res/screens/KitchenScreen/DoorClosedLightOn.png"});
+ queue.loadFile( {id: "res/screens/KitchenScreen/DoorClosedLightOff.png", src:"res/screens/KitchenScreen/DoorClosedLightOff.png"});
+ queue.loadFile( {id: "res/screens/KitchenScreen/CookbookKitchenGlow.png", src:"res/screens/KitchenScreen/CookbookKitchenGlow.png"});
+ queue.loadFile( {id: "res/screens/KitchenScreen/CookbookKitchen.png", src:"res/screens/KitchenScreen/CookbookKitchen.png"});
+ queue.loadFile( {id: "res/screens/KitchenScreen/AlarmKitchenGlow.png", src:"res/screens/KitchenScreen/AlarmKitchenGlow.png"});
+ queue.loadFile( {id: "res/screens/KitchenScreen/AlarmKitchen.png", src:"res/screens/KitchenScreen/AlarmKitchen.png"});
+
+ queue.loadFile( {id: "res/screens/KitchenScreen/PanFront.png", src:"res/screens/KitchenScreen/PanFront.png"});
+ queue.loadFile( {id: "res/screens/KitchenScreen/OvenTurnRedState.png", src:"res/screens/KitchenScreen/OvenTurnRedState.png"});
+ queue.loadFile( {id: "res/screens/KitchenScreen/LightButtonDepressed.png", src:"res/screens/KitchenScreen/LightButtonDepressed.png"});
+
// Market Items
- queue.loadFile( {id: "FrillsBox.png", src:"res/items/FrillsBox.png"} );
+
+ queue.loadFile( {id: "res/screens/MarketScreen/MarketTopShelf.png", src:"res/screens/MarketScreen/MarketTopShelf.png"});
+
+ queue.loadFile( {id: "res/items/Clipboard.png", src:"res/items/Clipboard.png"});
+ queue.loadFile( {id: "res/items/Wallet.png", src:"res/items/Wallet.png"});
+
+ queue.loadFile( {id: "res/items/FrillsBox.png", src:"res/items/ExitSign.png"});
+ queue.loadFile( {id: "res/items/FrillsBoxGlow.png", src:"res/items/ExitGlow.png"});
+
queue.loadFile( {id: "res/items/FrillsBox.png", src:"res/items/FrillsBox.png"});
queue.loadFile( {id: "res/items/FrillsBoxGlow.png", src:"res/items/FrillsBoxGlow.png"});
+
queue.loadFile( {id: "res/items/TempProbe.png", src:"res/items/TempProbe.png"});
queue.loadFile( {id: "res/items/TempProbeGlow.png", src:"res/items/TempProbeGlow.png"});
@@ -101,22 +154,30 @@ function GameState(){
// Game State flags
this.turkeyBought = false;
+ this.ovenLightBought = false;
+ var randomWeight = [ (UtilityFunctions.randRange(10,22)+"."+UtilityFunctions.randRange(10,99)),
+ (UtilityFunctions.randRange(10,22)+"."+UtilityFunctions.randRange(10,99)),
+ (UtilityFunctions.randRange(10,22)+"."+UtilityFunctions.randRange(10,99)),
+ (UtilityFunctions.randRange(10,22)+"."+UtilityFunctions.randRange(10,99)),
+ (UtilityFunctions.randRange(10,22)+"."+UtilityFunctions.randRange(10,99))
+ ];
+
this.marketItems = {
- "FrillsBox" : new MarketItem( this, "FrillsBox", 133,92, 2000, "res/items/FrillsBox.png", "res/items/FrillsBoxGlow.png" ),
- "TuTempProberkey" : new MarketItem( this, "TuTempProberkey", 200, 57, 100, "res/items/TempProbe.png", "res/items/TempProbeGlow.png" ),
- "OvenLightBox" : new MarketItem( this, "OvenLightBox", 131,222, 300, "res/items/OvenLightBox.png", "res/items/OvenLightBoxGlow.png" ),
-
- "Alarm" : new MarketItem( this, "Alarm", 173,248, 500, "res/items/Alarm.png", "res/items/AlarmGlow.png" ),
- "Cookbook" : new MarketItem( this, "Cookbook", 283,203, 400, "res/items/Cookbook1.png", "res/items/Cookbook1Glow.png" ),
- "StuffingRepurposed" : new MarketItem( this, "StuffingRepurposed", 510,197, 200, "res/items/StuffingRepurposed.png", "res/items/StuffingRepurposedGlow.png" ),
- "StuffingExquisite" : new MarketItem( this, "StuffingExquisite", 458,210, 300, "res/items/StuffingExquisite.png", "res/items/StuffingExquisiteGlow.png" ),
- "StuffingSpecial" : new MarketItem( this, "StuffingSpecial", 390,220, 500, "res/items/StuffingSpecial.png", "res/items/StuffingSpecialGlow.png" ),
-
- "Turkey1" : new MarketItem( this, "Turkey1", 170,350, 100, "res/items/Turkey5.png", "res/items/Turkey5Glow.png" ),
- "Turkey2": new MarketItem( this, "Turkey2", 540,320, 100, "res/items/Turkey4.png", "res/items/Turkey4Glow.png" ),
- "Turkey3" : new MarketItem( this, "Turkey3", 265,415, 100, "res/items/Turkey3.png", "res/items/Turkey3Glow.png" ),
- "Turkey4": new MarketItem( this, "Turkey4", 474,357, 100, "res/items/Turkey2.png", "res/items/Turkey2Glow.png" ),
- "Turkey5": new MarketItem( this, "Turkey5", 368,426, 100, "res/items/Turkey1.png", "res/items/Turkey1Glow.png" )
+ "Frills Box" : new MarketItem( this, "Frills Box", 133,92, 3.00, "res/items/FrillsBox.png", "res/items/FrillsBoxGlow.png", "Some people dress up their dogs. Others dress up their house. Why not dress up your turkey?" ),
+ "Temperature Probe" : new MarketItem( this, "Temperature Probe", 200, 57, 9.00, "res/items/TempProbe.png", "res/items/TempProbeGlow.png", "Ensure your food is cooked with this handy thermometer. Now with easy to read LED display" ),
+ "Oven Light in a Box" : new MarketItem( this, "Oven Light in a Box", 131,222, 15.00, "res/items/OvenLightBox.png", "res/items/OvenLightBoxGlow.png", "This will allow checking on your turkey without letting the heat out." ),
+
+ "Alarm Clock" : new MarketItem( this, "Alarm Clock", 173,248, 6.00, "res/items/Alarm.png", "res/items/AlarmGlow.png", "Have you ever wanted to control time? Now you can. Digital readout counts down until time of choice. Audible alarm" ),
+ "Cookbook" : new MarketItem( this, "Cookbook", 283,203, 3.00, "res/items/Cookbook1.png", "res/items/Cookbook1Glow.png", "How do I cook turkey? Handy note space included for writing down temperature measurements" ),
+ "Repurposed Stuffing" : new MarketItem( this, "Repurposed Stuffing", 510,197, 2.00, "res/items/StuffingRepurposed.png", "res/items/StuffingRepurposedGlow.png","At least 80% original breadcrumb. Guaranteed to contain no avian products" ),
+ "Exquisite Stuffing" : new MarketItem( this, "Exquisite Stuffing", 458,210, 3.00, "res/items/StuffingExquisite.png", "res/items/StuffingExquisiteGlow.png", "Colonial merchants once traveled the four reaches of the Earth to bring back the ingredients contained in this very box" ),
+ "Special Stuffing" : new MarketItem( this, "Special Stuffing", 390,220, 6.00, "res/items/StuffingSpecial.png", "res/items/StuffingSpecialGlow.png", "Once rated as the most handsome man in the universe. Scott and his patented special stuffing will set you on the path to food heaven" ),
+
+ "Organic Turkey" : new MarketItem( this, "Organic Turkey", 180,360, randomWeight[0]*2.00, "res/items/Turkey5.png", "res/items/Turkey5Glow.png", "All natural. No hormones. No antibiotics. Free Range. Lead Free", parseFloat(randomWeight[0]) ),
+ "Free Range Turkey": new MarketItem( this, "Free Range Turkey", 540,320, randomWeight[1]*1.25, "res/items/Turkey4.png", "res/items/Turkey4Glow.png", "Our turkeys have wide open spaces to roam and are fed with only the highest quality feed.", parseFloat(randomWeight[1]) ),
+ "Sunny Farms Turkey" : new MarketItem( this, "Sunny Farms Turkey", 265,415, randomWeight[2]*0.85, "res/items/Turkey3.png", "res/items/Turkey3Glow.png", "100% Turkey product from Sunny Farms Heavy Industries, Ltd.", parseFloat(randomWeight[2]) ),
+ "Pastured Turkey": new MarketItem( this, "Pastured Turkey", 474,357, randomWeight[3]*1.75, "res/items/Turkey2.png", "res/items/Turkey2Glow.png", "Grassy fields and natural ingredients allow our turkeys to have a better life, and taste great.", parseFloat(randomWeight[3]) ),
+ "General Turkey": new MarketItem( this, "General Turkey", 378,426, randomWeight[4]*1.00, "res/items/Turkey1.png", "res/items/Turkey1Glow.png", "100% General Satisfaction Guaranteed", parseFloat(randomWeight[4]) )
};
this.purchasedItems = [];
@@ -179,7 +240,7 @@ function GameUI( canvasElem, gameState ){
var soundManager = new SoundManager( gameState );
- this.activeScreenObj = new LoadingScreen( this.stage, gameState );
+ this.activeScreenObj = new KitchenScreen( this.stage, gameState );
var textContent = new createjs.Text( "", "20px Arial", "#00000000" );
textContent.x = 750;
textContent.y = 30;
diff --git a/js/screens.js b/js/screens.js
index 5c5e76e..869c11a 100644
--- a/js/screens.js
+++ b/js/screens.js
@@ -13,7 +13,6 @@ function LoadingScreen( stage, gameState ){
new createjs.Bitmap( "res/screens/LoadingScreen/TurkeyDone.png" ) ];
this.done.alpha= 0;
-
stage.addChild( this.picture );
stage.addChild( this.cooking );
stage.addChild( this.done );
@@ -96,7 +95,7 @@ function MainScreen( stage, gameState ){
var spriteSheet = new createjs.SpriteSheet(data);
var animation = new createjs.Sprite(spriteSheet, "stare");
- animation.x = 200;
+ animation.x = 140;
animation.y = 210;
animation.addEventListener("tick", handleTick);
@@ -109,6 +108,7 @@ function MainScreen( stage, gameState ){
stage.addChild(animation);
this.grassLayer = new createjs.Bitmap( "res/screens/MainScreen/Grass.png" );
+ this.grassLayer.x = -60;
stage.addChild( this.grassLayer );
// buttons info/credits/start
@@ -135,21 +135,74 @@ function MainScreen( stage, gameState ){
}
//start button
-
}
function DifficultyScreen( stage, gameState ){
var that = this;
- this.background = new createjs.Bitmap( "res/Difficulty-Selection.png" );
+ this.background = new createjs.Bitmap( "res/screens/DifficultyScreen/Difficulty-Selection.png" );
stage.addChild( this.background );
- // Easy/Hard Button
- stage.addChild( new Button( stage, gameState, 170, 40, 450, 105, "SwitchScreen", "KitchenScreen" ) );
- stage.addChild( new Button( stage, gameState, 170, 150, 450, 105, "SwitchScreen", "KitchenScreen" ) );
+ var turkeyAnimations = { peck:[14,24,"peck"], ruffle:[0,13,"ruffle"], stare:[25,35,"stare"] };
+ var data = {
+ images: ["res/screens/MainScreen/TurkeySprite.png"],
+ frames: { width:400, height:350 },
+ animations: turkeyAnimations
+ };
+
+ var spriteSheet = new createjs.SpriteSheet(data);
+ var animation = new createjs.Sprite(spriteSheet, "stare");
+ animation.x = 140;
+ animation.y = 210;
+
+ animation.addEventListener("tick", handleTick);
+ function handleTick(event) {
+ if ( turkeyAnimations[event.currentTarget.currentAnimation][1] == event.currentTarget.currentFrame ){
+ event.currentTarget.paused = true;
+ }
+ // Click happened.
+ }
+ stage.addChild(animation);
+
+ this.grassLayer = new createjs.Bitmap( "res/screens/MainScreen/Grass.png" );
+ this.grassLayer.x = -60;
+ stage.addChild( this.grassLayer );
+
+ // Difficulty selection UI
+ this.buttonsAndText = new createjs.Bitmap( "res/screens/DifficultyScreen/ButtonsandText.png" );
+ stage.addChild( this.buttonsAndText );
+
+ this.maleSelection = new createjs.Bitmap( "res/screens/DifficultyScreen/ButtonMale.png" );
+ stage.addChild( this.maleSelection );
+ this.femaleSelection = new createjs.Bitmap( "res/screens/DifficultyScreen/ButtonFemale.png" );
+ this.femaleSelection.alpha = 0;
+ stage.addChild( this.femaleSelection );
+
+ // Easy/Hard Button
+ stage.addChild( new Button( stage, gameState, 500, 235, 100, 55, "ChangeGender", "Male" ) );
+ stage.addChild( new Button( stage, gameState, 500, 300, 100, 55, "ChangeGender", "Female" ) );
+
+ stage.addChild( new Button( stage, gameState, 503, 370, 200, 55, "SwitchScreen", "KitchenScreen" ) );
+ stage.addChild( new Button( stage, gameState, 500, 495, 205, 55, "SwitchScreen", "KitchenScreen" ) );
+
+ stage.addChild( new Button( stage, gameState, 35, 495, 85, 55, "SwitchScreen", "MainScreen" ) );
+
+ gameState.pubsub.subscribe("ChangeGender", function(gender){
+ gameState.gender=gender;
+ if( gender == "Male" ){
+ that.maleSelection.alpha = 1;
+ that.femaleSelection.alpha = 0;
+ }else{
+ that.maleSelection.alpha = 0;
+ that.femaleSelection.alpha = 1;
+ }
+ })
return {
blit : function(){
+ if( createjs.Ticker.getTicks() %50 == 0 ){
+ animation.gotoAndPlay(["peck", "ruffle", "stare"][UtilityFunctions.randRange(0,2)]);
+ }
// Draw all the uiElements
for( var index in that.uiElems ){
@@ -165,7 +218,7 @@ function KitchenScreen( stage, gameState ){
// Fade out any other sounds
gameState.pubsub.publish( "FadeOut", "" );
- this.background = new createjs.Bitmap( "res/kitchen.png" );
+ this.background = new createjs.Bitmap( "res/screens/KitchenScreen/KitchenScreen.png" );
stage.addChild( this.background );
this.uiElems = [];
@@ -179,6 +232,7 @@ function KitchenScreen( stage, gameState ){
this.uiElems.push( new ClockUI( stage, gameState ) );
this.uiElems.push( new WindowUI( stage, gameState ) )
stage.addChild( new Button( stage, gameState, 500, 40, 450, 105, "SwitchScreen", "MarketScreen" ) );
+ stage.addChild( new Button( stage, gameState, 14, 17, 73, 45, "SwitchScreen", "HelpScreen" ) );
// If player did not buy a turkey, tell them
if( !gameState.turkeyBought ){
@@ -200,22 +254,52 @@ function MarketScreen( stage, gameState ){
var that = this;
this.background = new createjs.Bitmap( "res/screens/MarketScreen/MarketScreen.png" );
- var price = new createjs.Text( "100", "24px Arial", "#00000000" );
- price.x = 725;
- price.y = 500;
+ var price = new createjs.Text( "", "16px Arial", "#00000000" );
+ price.x = 120;
+ price.y = 560;
- var wallet = new createjs.Text( gameState.wallet, "24px Arial", "#00000000" );
+ var wallet = new createjs.Text( "$" + parseFloat(gameState.wallet).toFixed(2), "20px Arial", "#00000000" );
wallet.x = 725;
wallet.y = 550;
+ var walletTag = new createjs.Bitmap("res/items/Wallet.png");
+ walletTag.x = 670;
+ walletTag.y = 535;
+
+ var clipboardImg = new createjs.Bitmap("res/items/Clipboard.png");
+ clipboardImg.x = 5;
+ clipboardImg.y = 315;
+
+ var clipboardTitle = new createjs.Text( "Shopping List", "18px Arial", "#00000000" );
+ clipboardTitle.x = 25;
+ clipboardTitle.y = 385;
+ clipboardTitle.lineWidth = 175;
+
+ var clipboardText = new createjs.Text( "Turkey", "16px Arial", "#00000000" );
+ clipboardText.x = 23;
+ clipboardText.y = 425;
+ clipboardText.lineWidth = 175;
+
+ var clipboardWeight = new createjs.Text( "", "16px Arial", "#00000000" );
+ clipboardWeight.x = 120;
+ clipboardWeight.y = 540;
+ clipboardWeight.lineWidth = 175;
+
// Play soundz
gameState.pubsub.publish( "Play", {name:"Entrance", volume:0.3} );
gameState.pubsub.publish( "BackgroundLoop", {name:"MarketMusic", volume:1} );
gameState.pubsub.publish( "BackgroundLoop", {name:"MarketBackgroundSound", volume:0.4} );
- stage.addChild( this.background );
- stage.addChild(price);
+ stage.addChild(this.background);
+
stage.addChild(wallet);
+ stage.addChild(walletTag);
+ stage.addChild(clipboardImg);
+
+ stage.addChild(clipboardTitle);
+ stage.addChild(clipboardText);
+ stage.addChild(clipboardWeight);
+ stage.addChild(price);
this.uiElems = [];
this.uiElems.push( new ImgButton( stage, gameState, 690,0, "res/items/ExitSign.png", "res/items/ExitGlow.png","SwitchScreen", "KitchenScreen", "Click" ) );
@@ -223,20 +307,38 @@ function MarketScreen( stage, gameState ){
for (var index in marketItemKeys ) {
gameState.marketItems[marketItemKeys[index]].draw( stage );
}
- this.topground = new createjs.Bitmap( "res/screens/MarketTopShelf.png" );
+
+ this.topground = new createjs.Bitmap( "res/screens/MarketScreen/MarketTopShelf.png" );
stage.addChild( this.topground );
- this.showPrice = function( cost ){
- price.text = cost;
- }
- gameState.pubsub.subscribe( "ShowPrice", this.showPrice );
- this.setWalletAmount = function(newAmount){
- wallet.text=gameState.wallet=newAmount;
+ this.showPrice = function( cost ){
+ price.text = "$ " + ( cost == NaN ? "" : parseFloat(cost).toFixed(2) );
+ }
+
+ this.clearClipboard = function(){
+ price.text = "";
+ clipboardTitle.text = "";
+ clipboardText.text = "";
+ clipboardWeight.text = "";
+ }
+
+ this.showDesc = function( desc ){
+ clipboardTitle.text = desc.title;
+ clipboardText.text = desc.desc;
+ if( desc.weight ){
+ clipboardWeight.text = desc.weight.toFixed(2) + " lbs.";
+ }
+ }
+
+ this.setWalletAmount = function(newAmount){
+ wallet.text="$" + ( gameState.wallet=newAmount.toFixed(2) );
}
+ gameState.pubsub.subscribe("ShowDesc", this.showDesc);
+ gameState.pubsub.subscribe("ShowPrice", this.showPrice );
gameState.pubsub.subscribe("WalletAmount", this.setWalletAmount);
-
+ gameState.pubsub.subscribe("ClearClipboard", this.clearClipboard);
return {
blit : function(){
diff --git a/js/ui.js b/js/ui.js
index 696b4b0..2cffdc0 100644
--- a/js/ui.js
+++ b/js/ui.js
@@ -46,6 +46,11 @@ function ClockUI( stage, gameState ){
function OvenUI( stage, gameState ){
var that = this;
+ var OVEN_CLOSED = 0;
+ var OVEN_PEEK = 1;
+ var OVEN_OPEN = 2;
+
+ this.ovenDoor = OVEN_CLOSED;
// Important Model
var ovenModel = new OvenModel( 8, gameState );
@@ -69,13 +74,23 @@ function OvenUI( stage, gameState ){
temperatureText.y = 147;
temperatureText.textBaseline = "alphabetic";
- //Create a Shape DisplayObject.
- this.circle = new createjs.Shape();
- this.circle.graphics.beginFill( "red" ).drawCircle( 0, 0, 40 );
- this.circle.x = 0;
- this.circle.y = 0;
+ var lightPressedImg = new createjs.Bitmap( "res/screens/KitchenScreen/LightButtonDepressed.png" );
+ lightPressedImg.alpha = 0;
+
+ var doorClosedLightOff = new createjs.Bitmap( "res/screens/KitchenScreen/DoorClosedLightOff.png" );
+ doorClosedLightOff.alpha = 1;
+
+ var doorClosedLightOn = new createjs.Bitmap( "res/screens/KitchenScreen/DoorClosedLightOn.png" );
+ doorClosedLightOn.alpha = 0;
+ var doorPeekLightOff = new createjs.Bitmap( "res/screens/KitchenScreen/DoorPeekLightOff.png" );
+ doorPeekLightOff.alpha = 0;
+ var doorPeekLightOn = new createjs.Bitmap( "res/screens/KitchenScreen/DoorPeekLightOn.png" );
+ doorPeekLightOn.alpha = 0;
+
+ var doorOpen = new createjs.Bitmap( "res/screens/KitchenScreen/DoorOpen.png" );
+ doorOpen.alpha = 0;
this.changeTemperature = function( direction ){
@@ -101,8 +116,67 @@ function OvenUI( stage, gameState ){
ovenModel.changeTemp( UtilityFunctions.F2C( temperatureText.text == "OFF" ? 125 : parseInt( temperatureText.text ) ) );
}
- // change temperature, this one's for the UI
+ this.ovenLightToggle = function(){
+
+ lightPressedImg.alpha = lightPressedImg.alpha == 0 ? 1 : 0;
+ if( that.ovenDoor == OVEN_CLOSED){
+ doorClosedLightOn.alpha = lightPressedImg.alpha == 0 ? 0 : 1;
+ doorClosedLightOff.alpha = lightPressedImg.alpha == 0 ? 1 : 0;
+ doorOpen.alpha = 0;
+ }
+ else if( that.ovenDoor == OVEN_PEEK ){
+ doorPeekLightOn.alpha = lightPressedImg.alpha == 0 ? 0 : 1;
+ doorPeekLightOff.alpha = lightPressedImg.alpha == 0 ? 1 : 0;
+ doorOpen.alpha = 0;
+ }
+ }
+
+ var handleBar = new createjs.Shape();
+ handleBar.graphics.beginFill("#ffffff").drawRect(20, 190, 300, 20);
+ handleBar.alpha = 0.5;
+ handleBar.addEventListener( "mouseover", function(){ document.body.style.cursor='pointer'; } );
+ handleBar.addEventListener( "mouseout", function(){ document.body.style.cursor='default'; } );
+ handleBar.addEventListener( "pressup", handlePress );
+
+ // Look for a drag event
+ function handlePress(event) {
+ if( event.stageY > 300 && that.ovenDoor != OVEN_OPEN ){
+ that.ovenDoor = OVEN_OPEN;
+ doorPeekLightOn.alpha = doorClosedLightOn.alpha = 0;
+ doorPeekLightOff.alpha = doorClosedLightOff.alpha = 0;
+ doorOpen.alpha = 1;
+ handleBar.y = 330;
+ }else if (that.ovenDoor == OVEN_OPEN ){
+ that.ovenDoor = OVEN_PEEK;
+ ovenPeek();
+ }
+ }
+
+ handleBar.addEventListener( "click", ovenPeek );
+
+ function ovenPeek(){
+ if( that.ovenDoor == OVEN_CLOSED || that.ovenDoor == OVEN_OPEN ){
+ doorPeekLightOn.alpha = lightPressedImg.alpha == 0 ? 0 : 1;
+ doorPeekLightOff.alpha = lightPressedImg.alpha == 0 ? 1 : 0;
+ doorClosedLightOn.alpha = 0;
+ doorClosedLightOff.alpha = 0;
+ doorOpen.alpha = 0;
+ that.ovenDoor = OVEN_PEEK;
+ handleBar.y = 48;
+ }
+ else if (that.ovenDoor == OVEN_PEEK){
+ doorClosedLightOn.alpha = lightPressedImg.alpha == 0 ? 0 : 1;
+ doorClosedLightOff.alpha = lightPressedImg.alpha == 0 ? 1 : 0;
+ doorPeekLightOn.alpha = 0;
+ doorPeekLightOff.alpha = 0;
+ that.ovenDoor = OVEN_CLOSED;
+ doorOpen.alpha = 0;
+ handleBar.y = 0;
+ }
+ }
+ // change temperature, this one's for the UI
gameState.pubsub.subscribe( "ChangeTemperature", this.changeTemperature );
+ gameState.pubsub.subscribe( "OvenLightToggle", this.ovenLightToggle );
this.secondTick = function(){
ovenModel.secondTick();
@@ -112,21 +186,26 @@ function OvenUI( stage, gameState ){
setInterval(this.secondTick, 1000);
stage.addChild( this.text );
+ stage.addChild(lightPressedImg);
+ // Turkey goes here
- return {
- tick: function(){
- // Circle will move 10 units to the right.
- that.circle.x += 1;
+ stage.addChild(doorPeekLightOn);
+ stage.addChild(doorPeekLightOff);
- // Will cause the circle to wrap back
- if ( that.circle.x > stage.canvas.width ) { that.circle.x = 0; }
- },
+ stage.addChild(doorClosedLightOn);
+ stage.addChild(doorClosedLightOff);
+
+ stage.addChild(doorOpen);
+ stage.addChild(handleBar);
+
+ return {
+ tick: function(){},
render: function(){
//Set position of Shape instance.
- stage.addChild( that.circle );
stage.addChild( ovenLight );
stage.addChild( new Button( stage, gameState, 45, 163, 41, 17, "ChangeTemperature", "Up" ) );
stage.addChild( new Button( stage, gameState, 95, 163, 41, 17, "ChangeTemperature", "Down" ) );
+ stage.addChild( new Button( stage, gameState, 145, 163, 41, 17, "OvenLightToggle", "" ) );
stage.addChild( temperatureText );
return this;
}
@@ -139,28 +218,52 @@ return {
}
}
-function MarketItem( gameState, name, x, y, cost, mouseOutImg, mouseOverImg ){
+function MarketItem( gameState, name, x, y, cost, mouseOutImg, mouseOverImg, funnyDescription, weight ){
var that = this;
+ console.log("Loading market item" + name);
this.name = name;
this.bought = false;
var mouseOver = new createjs.Bitmap( mouseOverImg );
var mouseOut = new createjs.Bitmap( mouseOutImg );
mouseOver.x = mouseOut.x = x;
mouseOver.y = mouseOut.y = y;
- mouseOut.addEventListener( "mouseover", function(){ document.body.style.cursor='pointer'; mouseOver.visible = true; mouseOut.visible = false; gameState.pubsub.publish("ShowPrice", cost ); } );
- mouseOut.addEventListener( "mouseout", function(){ document.body.style.cursor='default'; mouseOver.visible = false; mouseOut.visible = true; gameState.pubsub.publish("ShowPrice", "" ); } );
- mouseOver.addEventListener( "mouseover", function(){ document.body.style.cursor='pointer'; mouseOver.visible = true; mouseOut.visible = false; gameState.pubsub.publish("ShowPrice", cost ); } );
- mouseOver.addEventListener( "mouseout", function(){ document.body.style.cursor='default'; mouseOver.visible = false; mouseOut.visible = true; gameState.pubsub.publish("ShowPrice", "" );} );
+ mouseOut.addEventListener( "mouseover", function(){
+ document.body.style.cursor='pointer';
+ mouseOver.visible = true;
+ mouseOut.visible = false;
+ gameState.pubsub.publish("ShowPrice", cost );
+ gameState.pubsub.publish("ShowDesc", {title:that.name, desc:funnyDescription, weight:weight} );
+ });
+ mouseOut.addEventListener( "mouseout", function(){
+ document.body.style.cursor='default';
+ mouseOver.visible = false;
+ mouseOut.visible = true;
+ gameState.pubsub.publish("ClearClipboard", {});
+ } );
+ mouseOver.addEventListener( "mouseover", function(){
+ document.body.style.cursor='pointer';
+ mouseOver.visible = true;
+ mouseOut.visible = false;
+ gameState.pubsub.publish("ShowPrice", cost );
+ gameState.pubsub.publish("ShowDesc", {title:that.name, desc:funnyDescription, weight:weight} );
+ });
+ mouseOver.addEventListener( "mouseout", function(){
+ document.body.style.cursor='default';
+ mouseOver.visible = false;
+ mouseOut.visible = true;
+ gameState.pubsub.publish("ClearClipboard", {});
+ } );
mouseOver.addEventListener( "click", function(){
if(!that.bought && cost <= gameState.wallet ){
- if( that.name.indexOf("Turkey") == 0 && gameState.turkeyBought != true){
+ console.log(that.name);
+ if( that.name.indexOf("Turkey") != -1 && gameState.turkeyBought != true){
gameState.turkeyBought = true;
gameState.marketItems[ that.name ].delete();
gameState.pubsub.publish("Play", {name:"Buy", volume:0.7} );
gameState.pubsub.publish("WalletAmount", gameState.wallet - Math.abs(cost))
}
// can we buy this? Only possible if you already bought a turkey
- else if( !that.name.indexOf("Turkey") == 0 && gameState.turkeyBought == true ){
+ else if( !that.name.indexOf("Turkey") != -1 && gameState.turkeyBought == true ){
gameState.purchasedItems.push( objReturn );
gameState.marketItems[ that.name ].delete();
that.bought = true;
@@ -168,7 +271,7 @@ function MarketItem( gameState, name, x, y, cost, mouseOutImg, mouseOverImg ){
gameState.pubsub.publish("WalletAmount", gameState.wallet - Math.abs(cost));
}
// One turkey only
- else if( that.name.indexOf("Turkey") == 0 && gameState.turkeyBought == true ){
+ else if( that.name.indexOf("Turkey") != -1 && gameState.turkeyBought == true ){
gameState.pubsub.publish( "ShowDialog", {seq:"CannotBuyTurkey", autoAdvance:false} );
gameState.pubsub.publish( "Play", "Error" );
}
diff --git a/res/items/.DS_Store b/res/items/.DS_Store
index 3066a5c..6870db6 100644
Binary files a/res/items/.DS_Store and b/res/items/.DS_Store differ
diff --git a/res/items/Clipboard.png b/res/items/Clipboard.png
new file mode 100755
index 0000000..e481233
Binary files /dev/null and b/res/items/Clipboard.png differ
diff --git a/res/items/Price-Tag.png b/res/items/Price-Tag.png
new file mode 100755
index 0000000..6373e5a
Binary files /dev/null and b/res/items/Price-Tag.png differ
diff --git a/res/items/Wallet.png b/res/items/Wallet.png
new file mode 100755
index 0000000..d32b848
Binary files /dev/null and b/res/items/Wallet.png differ
diff --git a/res/kitchen.png b/res/kitchen.png
deleted file mode 100644
index dd2cbd9..0000000
Binary files a/res/kitchen.png and /dev/null differ
diff --git a/res/screens/.DS_Store b/res/screens/.DS_Store
index 9015944..6feaaa8 100644
Binary files a/res/screens/.DS_Store and b/res/screens/.DS_Store differ
diff --git a/res/screens/DifficultyScreen/.DS_Store b/res/screens/DifficultyScreen/.DS_Store
new file mode 100644
index 0000000..bbcd433
Binary files /dev/null and b/res/screens/DifficultyScreen/.DS_Store differ
diff --git a/res/screens/DifficultyScreen/ButtonFemale.png b/res/screens/DifficultyScreen/ButtonFemale.png
new file mode 100644
index 0000000..ffaa8e4
Binary files /dev/null and b/res/screens/DifficultyScreen/ButtonFemale.png differ
diff --git a/res/screens/DifficultyScreen/ButtonMale.png b/res/screens/DifficultyScreen/ButtonMale.png
new file mode 100644
index 0000000..3e9b457
Binary files /dev/null and b/res/screens/DifficultyScreen/ButtonMale.png differ
diff --git a/res/screens/DifficultyScreen/ButtonsandText.png b/res/screens/DifficultyScreen/ButtonsandText.png
new file mode 100644
index 0000000..6184d09
Binary files /dev/null and b/res/screens/DifficultyScreen/ButtonsandText.png differ
diff --git a/res/screens/DifficultyScreen/Difficulty-Selection.png b/res/screens/DifficultyScreen/Difficulty-Selection.png
new file mode 100644
index 0000000..7442f97
Binary files /dev/null and b/res/screens/DifficultyScreen/Difficulty-Selection.png differ
diff --git a/res/screens/KitchenScreen/.DS_Store b/res/screens/KitchenScreen/.DS_Store
new file mode 100644
index 0000000..67f13db
Binary files /dev/null and b/res/screens/KitchenScreen/.DS_Store differ
diff --git a/res/screens/KitchenScreen/AlarmKitchen.png b/res/screens/KitchenScreen/AlarmKitchen.png
new file mode 100644
index 0000000..30d25a3
Binary files /dev/null and b/res/screens/KitchenScreen/AlarmKitchen.png differ
diff --git a/res/screens/KitchenScreen/AlarmKitchenGlow.png b/res/screens/KitchenScreen/AlarmKitchenGlow.png
new file mode 100644
index 0000000..aa77172
Binary files /dev/null and b/res/screens/KitchenScreen/AlarmKitchenGlow.png differ
diff --git a/res/screens/KitchenScreen/CookbookKitchen.png b/res/screens/KitchenScreen/CookbookKitchen.png
new file mode 100644
index 0000000..e44b5ba
Binary files /dev/null and b/res/screens/KitchenScreen/CookbookKitchen.png differ
diff --git a/res/screens/KitchenScreen/CookbookKitchenGlow.png b/res/screens/KitchenScreen/CookbookKitchenGlow.png
new file mode 100644
index 0000000..80de0e8
Binary files /dev/null and b/res/screens/KitchenScreen/CookbookKitchenGlow.png differ
diff --git a/res/screens/KitchenScreen/DoorClosedLightOff.png b/res/screens/KitchenScreen/DoorClosedLightOff.png
new file mode 100644
index 0000000..6adfb4c
Binary files /dev/null and b/res/screens/KitchenScreen/DoorClosedLightOff.png differ
diff --git a/res/screens/KitchenScreen/DoorClosedLightOn.png b/res/screens/KitchenScreen/DoorClosedLightOn.png
new file mode 100644
index 0000000..202cfd5
Binary files /dev/null and b/res/screens/KitchenScreen/DoorClosedLightOn.png differ
diff --git a/res/screens/KitchenScreen/DoorOpen.png b/res/screens/KitchenScreen/DoorOpen.png
new file mode 100644
index 0000000..3e8dafe
Binary files /dev/null and b/res/screens/KitchenScreen/DoorOpen.png differ
diff --git a/res/screens/KitchenScreen/DoorPeekLightOff.png b/res/screens/KitchenScreen/DoorPeekLightOff.png
new file mode 100644
index 0000000..86421f4
Binary files /dev/null and b/res/screens/KitchenScreen/DoorPeekLightOff.png differ
diff --git a/res/screens/KitchenScreen/DoorPeekLightOn.png b/res/screens/KitchenScreen/DoorPeekLightOn.png
new file mode 100644
index 0000000..7764f84
Binary files /dev/null and b/res/screens/KitchenScreen/DoorPeekLightOn.png differ
diff --git a/res/screens/KitchenScreen/FrillsBoxKitchen.png b/res/screens/KitchenScreen/FrillsBoxKitchen.png
new file mode 100644
index 0000000..d447405
Binary files /dev/null and b/res/screens/KitchenScreen/FrillsBoxKitchen.png differ
diff --git a/res/screens/KitchenScreen/FrillsBoxKitchenGlow.png b/res/screens/KitchenScreen/FrillsBoxKitchenGlow.png
new file mode 100644
index 0000000..4d89617
Binary files /dev/null and b/res/screens/KitchenScreen/FrillsBoxKitchenGlow.png differ
diff --git a/res/screens/KitchenScreen/KitchenScreen.png b/res/screens/KitchenScreen/KitchenScreen.png
new file mode 100644
index 0000000..a6b3300
Binary files /dev/null and b/res/screens/KitchenScreen/KitchenScreen.png differ
diff --git a/res/screens/KitchenScreen/KitchenScreenMockup.png b/res/screens/KitchenScreen/KitchenScreenMockup.png
new file mode 100644
index 0000000..78d55e9
Binary files /dev/null and b/res/screens/KitchenScreen/KitchenScreenMockup.png differ
diff --git a/res/screens/KitchenScreen/LightButtonDepressed.png b/res/screens/KitchenScreen/LightButtonDepressed.png
new file mode 100644
index 0000000..06bc822
Binary files /dev/null and b/res/screens/KitchenScreen/LightButtonDepressed.png differ
diff --git a/res/screens/KitchenScreen/OvenTurnRedState.png b/res/screens/KitchenScreen/OvenTurnRedState.png
new file mode 100644
index 0000000..f66841e
Binary files /dev/null and b/res/screens/KitchenScreen/OvenTurnRedState.png differ
diff --git a/res/screens/KitchenScreen/PanFront.png b/res/screens/KitchenScreen/PanFront.png
new file mode 100644
index 0000000..de831fe
Binary files /dev/null and b/res/screens/KitchenScreen/PanFront.png differ
diff --git a/res/screens/KitchenScreen/StoreBrochure.png b/res/screens/KitchenScreen/StoreBrochure.png
new file mode 100644
index 0000000..ce54edb
Binary files /dev/null and b/res/screens/KitchenScreen/StoreBrochure.png differ
diff --git a/res/screens/KitchenScreen/StoreBrochureGlow.png b/res/screens/KitchenScreen/StoreBrochureGlow.png
new file mode 100644
index 0000000..adfbffd
Binary files /dev/null and b/res/screens/KitchenScreen/StoreBrochureGlow.png differ
diff --git a/res/screens/KitchenScreen/StuffingExquisiteKitchen.png b/res/screens/KitchenScreen/StuffingExquisiteKitchen.png
new file mode 100644
index 0000000..cfd3604
Binary files /dev/null and b/res/screens/KitchenScreen/StuffingExquisiteKitchen.png differ
diff --git a/res/screens/KitchenScreen/StuffingExquisiteKitchenGlow.png b/res/screens/KitchenScreen/StuffingExquisiteKitchenGlow.png
new file mode 100644
index 0000000..bc768bc
Binary files /dev/null and b/res/screens/KitchenScreen/StuffingExquisiteKitchenGlow.png differ
diff --git a/res/screens/KitchenScreen/StuffingRepurposedKitchen.png b/res/screens/KitchenScreen/StuffingRepurposedKitchen.png
new file mode 100644
index 0000000..d589cb6
Binary files /dev/null and b/res/screens/KitchenScreen/StuffingRepurposedKitchen.png differ
diff --git a/res/screens/KitchenScreen/StuffingRepurposedKitchenGlow.png b/res/screens/KitchenScreen/StuffingRepurposedKitchenGlow.png
new file mode 100644
index 0000000..066cf52
Binary files /dev/null and b/res/screens/KitchenScreen/StuffingRepurposedKitchenGlow.png differ
diff --git a/res/screens/KitchenScreen/StuffingSpecialKitchen.png b/res/screens/KitchenScreen/StuffingSpecialKitchen.png
new file mode 100644
index 0000000..fee4105
Binary files /dev/null and b/res/screens/KitchenScreen/StuffingSpecialKitchen.png differ
diff --git a/res/screens/KitchenScreen/StuffingSpecialKitchenGlow.png b/res/screens/KitchenScreen/StuffingSpecialKitchenGlow.png
new file mode 100644
index 0000000..9b3d01b
Binary files /dev/null and b/res/screens/KitchenScreen/StuffingSpecialKitchenGlow.png differ
diff --git a/res/screens/KitchenScreen/TempProbeKitchen.png b/res/screens/KitchenScreen/TempProbeKitchen.png
new file mode 100644
index 0000000..68ff55d
Binary files /dev/null and b/res/screens/KitchenScreen/TempProbeKitchen.png differ
diff --git a/res/screens/KitchenScreen/TempProbeKitchenGlow.png b/res/screens/KitchenScreen/TempProbeKitchenGlow.png
new file mode 100644
index 0000000..49e3793
Binary files /dev/null and b/res/screens/KitchenScreen/TempProbeKitchenGlow.png differ
diff --git a/res/screens/KitchenScreen/TurkeyState1.svg b/res/screens/KitchenScreen/TurkeyState1.svg
new file mode 100644
index 0000000..860e8d1
--- /dev/null
+++ b/res/screens/KitchenScreen/TurkeyState1.svg
@@ -0,0 +1,7695 @@
+
+
+
+
diff --git a/res/screens/KitchenScreen/TurkeyState2.svg b/res/screens/KitchenScreen/TurkeyState2.svg
new file mode 100644
index 0000000..ad340e7
--- /dev/null
+++ b/res/screens/KitchenScreen/TurkeyState2.svg
@@ -0,0 +1,9288 @@
+
+
+
+
diff --git a/res/screens/KitchenScreen/TurkeyState3.svg b/res/screens/KitchenScreen/TurkeyState3.svg
new file mode 100644
index 0000000..e678dbd
--- /dev/null
+++ b/res/screens/KitchenScreen/TurkeyState3.svg
@@ -0,0 +1,9290 @@
+
+
+
+
diff --git a/res/screens/KitchenScreen/TurkeyState4.svg b/res/screens/KitchenScreen/TurkeyState4.svg
new file mode 100644
index 0000000..6bf0fc7
--- /dev/null
+++ b/res/screens/KitchenScreen/TurkeyState4.svg
@@ -0,0 +1,10920 @@
+
+
+
+
diff --git a/res/screens/KitchenScreen/TurkeyState5.svg b/res/screens/KitchenScreen/TurkeyState5.svg
new file mode 100644
index 0000000..0aa3a73
--- /dev/null
+++ b/res/screens/KitchenScreen/TurkeyState5.svg
@@ -0,0 +1,12955 @@
+
+
+
+
diff --git a/res/screens/MainScreen/.DS_Store b/res/screens/MainScreen/.DS_Store
index b5645ef..5eab2bd 100644
Binary files a/res/screens/MainScreen/.DS_Store and b/res/screens/MainScreen/.DS_Store differ
diff --git a/res/screens/MainScreen/ButtonHelp.png b/res/screens/MainScreen/ButtonHelp.png
old mode 100644
new mode 100755
index d6ab1b5..8a7c3d4
Binary files a/res/screens/MainScreen/ButtonHelp.png and b/res/screens/MainScreen/ButtonHelp.png differ