diff --git a/js/main.js b/js/main.js index 1c8edd6..b01eece 100644 --- a/js/main.js +++ b/js/main.js @@ -8,7 +8,7 @@ function GameState(){ this.name = ""; this.gender = "Male"; - this.wallet = 40.00; + this.wallet = 45.00; this.hard = false; this.boughtOvenLight = false; this.turkeyWeight = 8; @@ -231,11 +231,11 @@ function GameState(){ "res/screens/KitchenScreen/StuffingSpecialKitchen.png","res/screens/KitchenScreen/StuffingSpecialKitchenGlow.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]*1.6, "res/items/Turkey5.png", "res/items/Turkey5Glow.png",null,null, "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.20, "res/items/Turkey4.png", "res/items/Turkey4Glow.png",null,null, "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.80, "res/items/Turkey3.png", "res/items/Turkey3Glow.png",null,null, "100% Turkey product from Sunny Farms Heavy Industries, Ltd.", parseFloat(randomWeight[2]) ), + "Organic Turkey" : new MarketItem( this, "Organic Turkey", 180,360, randomWeight[0]*1.2, "res/items/Turkey5.png", "res/items/Turkey5Glow.png",null,null, "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.00, "res/items/Turkey4.png", "res/items/Turkey4Glow.png",null,null, "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.60, "res/items/Turkey3.png", "res/items/Turkey3Glow.png",null,null, "100% Turkey product from Sunny Farms Heavy Industries, Ltd.", parseFloat(randomWeight[2]) ), "Pastured Turkey": new MarketItem( this, "Pastured Turkey", 474,357, randomWeight[3]*1.4, "res/items/Turkey2.png", "res/items/Turkey2Glow.png",null,null, "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",null,null, "100% General Satisfaction Guaranteed", parseFloat(randomWeight[4]) ) + "General Turkey": new MarketItem( this, "General Turkey", 378,426, randomWeight[4]*0.80, "res/items/Turkey1.png", "res/items/Turkey1Glow.png",null,null, "100% General Satisfaction Guaranteed", parseFloat(randomWeight[4]) ) }; this.purchasedItems = []; @@ -244,7 +244,7 @@ function GameState(){ this.kitchenIntro = false; this.addRecord = function( record ){ - that.peekRecords.push( new Record( new Date(), record ) ); + that.peekRecords.push( new Record( record.type, that.currentTime, record.text ) ); } that.pubsub.subscribe( "AddRecord", this.addRecord ); @@ -283,7 +283,7 @@ function GameUI( canvasElem, gameState ){ var SCREEN_STABLE = 0; this.stage = new createjs.Stage( canvasElem ); - this.stage.enableMouseOver(20); + this.stage.enableMouseOver(25); this.activeScreenName = "EndingScreen"; this.activeScreenObj = {}; @@ -367,13 +367,16 @@ function GameUI( canvasElem, gameState ){ } } -function Record( dateTime, record ){ +function Record( type, dateTime, record ){ return { getTime: function(){ return dateTime; }, getContent: function(){ return record; + }, + getType: function(){ + return type; } } } diff --git a/js/ui.js b/js/ui.js index 7518f9f..19aa2bb 100644 --- a/js/ui.js +++ b/js/ui.js @@ -65,20 +65,19 @@ function CookbookUI( stage, gameState ){ // Show core temperature this.showCookbook = function(){ if( !that.showingCookbook ){ - console.log("show cookbook---" + gameState.peekRecords ); stage.addChild( cookbookImg ); stage.addChild( closeButton ); for( i in gameState.peekRecords ){ var record = gameState.peekRecords[i]; - gameState.peekRecords[i].getTime(); + var time = new Date( gameState.peekRecords[i].getTime() ); var logLine = new createjs.Text( "OFF", "12px Arial", "#ffffffff" ); - logLine.x = 520; + logLine.x = 423; logLine.y = 50 * i+ 165; logLine.textBaseline = "alphabetic"; - logLine.text = record.getContent(); + logLine.text = record.getType() + " " + time.getHours() + ":" + time.getMinutes() + " " + record.getContent(); logEntries.push(logLine); stage.addChild(logLine); @@ -115,7 +114,7 @@ function OvenUI( stage, gameState ){ ovenLight.visible = true; } } - + this.doneSkipTime = true; var turkeyStates = [ new createjs.Bitmap( "res/screens/KitchenScreen/TurkeyState1Small.svg" ), new createjs.Bitmap( "res/screens/KitchenScreen/TurkeyState2Small.svg" ), @@ -279,8 +278,8 @@ function OvenUI( stage, gameState ){ } else{ state = ovenModel.getTurkeyState(); - gameState.pubsub.publish( "ShowDialog", {seq:"custom", autoAdvance:false, customText:"Hmm.. the core temperature of the turkey is " + UtilityFunctions.C2F(state.core.temp).toFixed(2) + " F" } ); - gameState.pubsub.publish( "AddRecord", "Core temperature measured: " + UtilityFunctions.C2F(state.core.temp).toFixed(2) + " F" ); + gameState.pubsub.publish( "ShowDialog", {seq:"custom", autoAdvance:false, customText:"The core temperature of the turkey reads " + UtilityFunctions.C2F(state.core.temp).toFixed(2) + " F" } ); + gameState.pubsub.publish( "AddRecord", {type:"Probe", text:"Core temperature measured: " + UtilityFunctions.C2F(state.core.temp).toFixed(2) + " F"} ); } } @@ -292,7 +291,7 @@ function OvenUI( stage, gameState ){ gameState.pubsub.subscribe( "OvenLightToggle", this.ovenLightToggle ); gameState.pubsub.subscribe( "OvenLight", this.changeOvenLight ); gameState.pubsub.subscribe( "StartTurkeyModel", this.startTurkeyModel ); - + gameState.pubsub.subscribe("DoneSkipTime", function(){ that.doneSkipTime = true; }); this.secondTick = function(diff){ ovenModel.secondTick(); @@ -304,6 +303,7 @@ function OvenUI( stage, gameState ){ for(var i = 0; i < 1200; i++){ that.secondTick( 1000 ); } + gameState.pubsub.publish("DoneSkipTime",""); }); return { @@ -379,7 +379,12 @@ function OvenUI( stage, gameState ){ stage.addChild( new Button( stage, gameState, 95, 163, 41, 17, "ChangeTemperature", "Down" ) ); stage.addChild( new Button( stage, gameState, 145, 163, 41, 17, "OvenLightToggle", "" ) ); if( gameState.hard == false ) - stage.addChild( new Button( stage, gameState, 220, 120, 50, 50, "SkipTime", "" ) ); + stage.addChild( new Button( stage, gameState, 220, 120, 50, 50, null, null, function(){ + if( that.doneSkipTime ){ + gameState.pubsub.publish("SkipTime",""); + that.doneSkipTime = false; + } + }) ); stage.addChild( handleBar); return this; } @@ -388,10 +393,15 @@ function OvenUI( stage, gameState ){ function WindowUI( stage, gameState ){ - var dayNight = new createjs.Bitmap("res/Test4-217.svg"); + var dayNight = new createjs.Bitmap("res/screens/Window/Test4-217.svg"); + var mood = new createjs.Bitmap("res/screens/Window/Test4TransparencyFull.svg"); + + mood.y=30; dayNight.y=30; + var secondCounter = 0; - dayNight.x = -(new Date().getHours()*682.625); + dayNight.x = -(new Date( gameState.currentTime ).getHours()*682.625); + mood.x = -(new Date( gameState.currentTime ).getHours()*682.625); var ground = new createjs.Bitmap( "res/screens/Window/Ground.png" ); var houses = new createjs.Bitmap( "res/screens/Window/Housefar.png" ); @@ -411,7 +421,8 @@ function WindowUI( stage, gameState ){ // Fast forward, move sky gameState.pubsub.subscribe( "SkipTime", function(){ - dayNight.x -= dayNight.x < -15583 ? 0 : (11.38 * 20); + var newpos = -(new Date( gameState.currentTime ).getHours()*682.625); + mood.x = dayNight.x = newpos < -15583 ? 0 : newpos; }); stage.addChild( dayNight ); @@ -419,6 +430,7 @@ function WindowUI( stage, gameState ){ stage.addChild( houses ); stage.addChild( streetLight ); stage.addChild( animation ); + stage.addChild( mood ); return { tick: function(){ diff --git a/res/screens/.DS_Store b/res/screens/.DS_Store index 7c3b049..714f498 100644 Binary files a/res/screens/.DS_Store and b/res/screens/.DS_Store differ diff --git a/res/screens/EndScreen/.DS_Store b/res/screens/EndScreen/.DS_Store new file mode 100644 index 0000000..5fe3dcd Binary files /dev/null and b/res/screens/EndScreen/.DS_Store differ diff --git a/res/screens/EndScreen/FrillsSmall.svg b/res/screens/EndScreen/FrillsSmall.svg new file mode 100644 index 0000000..ef1ec35 --- /dev/null +++ b/res/screens/EndScreen/FrillsSmall.svg @@ -0,0 +1,739 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/res/screens/KitchenScreen/.DS_Store b/res/screens/KitchenScreen/.DS_Store index 8707b5c..f17e463 100644 Binary files a/res/screens/KitchenScreen/.DS_Store and b/res/screens/KitchenScreen/.DS_Store differ diff --git a/res/screens/ScoreScreen/.DS_Store b/res/screens/ScoreScreen/.DS_Store index 5008ddf..9fb346c 100644 Binary files a/res/screens/ScoreScreen/.DS_Store and b/res/screens/ScoreScreen/.DS_Store differ diff --git a/res/screens/ScoreScreen/Score-Tally.png b/res/screens/ScoreScreen/Score-Tally.png new file mode 100644 index 0000000..8338e59 Binary files /dev/null and b/res/screens/ScoreScreen/Score-Tally.png differ diff --git a/res/screens/Window/.DS_Store b/res/screens/Window/.DS_Store index 2eaf118..1d32e10 100644 Binary files a/res/screens/Window/.DS_Store and b/res/screens/Window/.DS_Store differ