Browse Source

Dialogue and changes

Load_Fix
Robert Chen 11 years ago
parent
commit
8856d4725a
  1. 4
      index.html
  2. 18
      js/dialogue.js
  3. 12
      js/main.js
  4. 43
      js/screens.js
  5. 1
      js/soundmanager.js
  6. 424
      js/stories.js
  7. 103
      js/ui.js
  8. BIN
      res/screens/.DS_Store
  9. BIN
      res/screens/HelpCreditsScreen/.DS_Store
  10. BIN
      res/sound/.DS_Store
  11. BIN
      res/sound/Events/.DS_Store
  12. BIN
      res/sound/Kitchen/.DS_Store
  13. BIN
      res/sound/Kitchen/sizzle.mp3

4
index.html

@ -1,9 +1,11 @@ @@ -1,9 +1,11 @@
<html>
<head>
<title>Turkey Baking Simulator</title>
<style type="text/css">
</style>
</head>
<body>
<br/><br/><br/><br/>
<center>
<div class="canvasContainer">
<canvas id="demoCanvas" width="800" height="600" style="border:1px solid #000000"></canvas>

18
js/dialogue.js

@ -33,6 +33,8 @@ function DialogUI( stage, gameState ){ @@ -33,6 +33,8 @@ function DialogUI( stage, gameState ){
"Male": new createjs.Bitmap("res/people/PlayerMale.png")
};
var dialogueList = Object.keys(story);
this.dialogSpeed = 30;
this.dialogState = DIALOG_PAUSING;
@ -67,10 +69,22 @@ function DialogUI( stage, gameState ){ @@ -67,10 +69,22 @@ function DialogUI( stage, gameState ){
peopleImg["Me"] = peopleImg[gameState.gender];
}
if( !peopleImg["Spouse"] ){
if( gameState.gender == "Male" ){
peopleImg["Spouse"] = peopleImg["Girlfriend"] ;
}else{
peopleImg["Spouse"] = peopleImg["Boyfriend"] ;
}
}
if( textSeq.seq == "custom" ){
messages["custom"] = ["Me: " + textSeq.customText ];
}
if( textSeq.random ){
that.showRandomConvo();
}
that.currDialogueSeq = new DialogueSequence( textSeq.seq );
var nextDialogue = that.currDialogueSeq.next();
@ -82,11 +96,11 @@ function DialogUI( stage, gameState ){ @@ -82,11 +96,11 @@ function DialogUI( stage, gameState ){
}
this.showRandomConvo = function(){
storyArray = Object.keys(stories);
dialogueList = Object.keys(story);
// check if there is something going on
if( !that.currDialogueSeq.more() ){
this.showDialog( storyArray[ UtilityFunctions.randRange(0, storyArray.length) ] );
this.showDialog( story[ dialogueList[ UtilityFunctions.randRange(0, dialogueList.length) ] ] || story["Dad Tells a bad Joke"] );
}
}

12
js/main.js

@ -5,6 +5,7 @@ function GameState(){ @@ -5,6 +5,7 @@ function GameState(){
BindPubSub( this.pubsub );
this.currentTime = new Date().getTime();
this.oldTime = new Date().getTime();
this.oldDialogueTime = new Date().getTime();
this.gameStarted = false;
this.name = "";
@ -14,6 +15,13 @@ function GameState(){ @@ -14,6 +15,13 @@ function GameState(){
this.boughtOvenLight = false;
this.turkeyWeight = 8;
this.peekRecords = [];
this.turkeyCooking = false;
// stats
this.storeVisits = 0;
this.dialogHeard = 0;
this.ovenOpened = 0;
// Game State flags
this.turkeyBought = false;
var randomWeight = [ (UtilityFunctions.randRange(10,22)+"."+UtilityFunctions.randRange(10,99)),
@ -129,6 +137,7 @@ function GameState(){ @@ -129,6 +137,7 @@ function GameState(){
queue.loadFile( {id: "res/sound/Kitchen/Oven_Door_Peek_Open.mp3", src:"res/sound/Kitchen/Oven_Door_Peek_Open.mp3"});
queue.loadFile( {id: "res/sound/Kitchen/Close_Cookbook.mp3", src:"res/sound/Kitchen/Close_Cookbook.mp3"});
queue.loadFile( {id: "res/sound/Kitchen/Open_Cookbook.mp3", src:"res/sound/Kitchen/Open_Cookbook.mp3"});
queue.loadFile( {id: "res/sound/Kitchen/sizzle.mp3", src:"res/sound/Kitchen/sizzle.mp3"} );
// Market Items
queue.loadFile( {id: "res/screens/MarketScreen/MarketTopShelf.png", src:"res/screens/MarketScreen/MarketTopShelf.png"});
@ -231,7 +240,7 @@ function GameState(){ @@ -231,7 +240,7 @@ function GameState(){
"Alarm Clock" : new MarketItem( this, "Alarm Clock", 173,248, 6.00, "res/items/Alarm.png", "res/items/AlarmGlow.png", "res/screens/KitchenScreen/AlarmKitchen.png", "res/screens/KitchenScreen/AlarmKitchenGlow.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","res/screens/KitchenScreen/CookbookKitchen.png", "res/screens/KitchenScreen/CookbookKitchenGlow.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/StuffingRepurposed.png", "res/screens/KitchenScreen/StuffingRepurposedKitchen.png", "res/screens/KitchenScreen/StuffingRepurposedKitchenGlow.png","At least 80% original breadcrumb. Guaranteed to contain no avian products" ),
"Repurposed Stuffing" : new MarketItem( this, "Repurposed Stuffing", 510,197, 2.00, "res/items/StuffingRepurposed.png", "res/items/StuffingRepurposedGlow.png", "res/screens/KitchenScreen/StuffingRepurposedKitchen.png", "res/screens/KitchenScreen/StuffingRepurposedKitchenGlow.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", "res/screens/KitchenScreen/StuffingExquisiteKitchen.png","res/screens/KitchenScreen/StuffingExquisiteKitchenGlow.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",
@ -298,7 +307,6 @@ function GameUI( canvasElem, gameState ){ @@ -298,7 +307,6 @@ function GameUI( canvasElem, gameState ){
/* Initialize All Screens */
this.screens = {
"LoadingScreen" : LoadingScreen,
"HelpScreen" : HelpScreen,
"MainScreen" : MainScreen,
"DifficultyScreen" : DifficultyScreen,
"KitchenScreen" : KitchenScreen,

43
js/screens.js

@ -79,6 +79,7 @@ function MainScreen( stage, gameState ){ @@ -79,6 +79,7 @@ function MainScreen( stage, gameState ){
animation.x = 140;
animation.y = 210;
new HelpUI(stage, gameState);
animation.addEventListener("tick", handleTick);
function handleTick(event){
if ( turkeyAnimations[event.currentTarget.currentAnimation][1] == event.currentTarget.currentFrame ){
@ -94,7 +95,7 @@ function MainScreen( stage, gameState ){ @@ -94,7 +95,7 @@ function MainScreen( stage, gameState ){
// buttons info/credits/start
new ImgButton( stage, gameState, 571,527, "res/screens/MainScreen/ButtonStart.png", "res/screens/MainScreen/ButtonStart.png","SwitchScreen", "DifficultyScreen", "Click" );
new ImgButton( stage, gameState, 17,470, "res/screens/MainScreen/ButtonHelp.png", "res/screens/MainScreen/ButtonHelp.png","SwitchScreen", "HelpScreen", "Click" );
new ImgButton( stage, gameState, 17,470, "res/screens/MainScreen/ButtonHelp.png", "res/screens/MainScreen/ButtonHelp.png",null, null, "Click", function(){ gameState.pubsub.publish("ShowHelp",""); } );
new ImgButton( stage, gameState, 17,527, "res/screens/MainScreen/ButtonCredits.png", "res/screens/MainScreen/ButtonCredits.png","SwitchScreen", "CreditsScreen", "Click" );
gameState.pubsub.publish( "BackgroundLoop", {name:"TitleMusic", pos:5650, volume:1} );
@ -102,8 +103,6 @@ function MainScreen( stage, gameState ){ @@ -102,8 +103,6 @@ function MainScreen( stage, gameState ){
return {
blit : function(){
// Randomly do stuff
if( createjs.Ticker.getTicks() %50 == 0 ){
animation.gotoAndPlay(["peck", "ruffle", "stare"][UtilityFunctions.randRange(0,2)]);
@ -243,6 +242,7 @@ function KitchenScreen( stage, gameState ){ @@ -243,6 +242,7 @@ function KitchenScreen( stage, gameState ){
// Fade out any other sounds
gameState.pubsub.publish( "FadeOut", "" );
//gameState.pubsub.publish( "BackgroundLoop", {name:"Sizzle", pos:0, volume:0.5} );
this.uiElems = [];
this.uiElems.push( new WindowUI( stage, gameState ) );
@ -260,13 +260,16 @@ function KitchenScreen( stage, gameState ){ @@ -260,13 +260,16 @@ function KitchenScreen( stage, gameState ){
this.uiElems.push( new ClockUI( stage, gameState ) );
stage.addChild( new Button( stage, gameState, 14, 17, 73, 45, "SwitchScreen", "HelpScreen" ) );
stage.addChild( new Button( stage, gameState, 14, 17, 73, 45, null,null, function(){ gameState.pubsub.publish("ShowHelp","");} ) );
new ImgButton( stage, gameState, 0,0, "res/screens/KitchenScreen/StoreBrochure.png", "res/screens/KitchenScreen/StoreBrochureGlow.png", "SwitchScreen", "MarketScreen", "Click" );
new ImgButton( stage, gameState, 0,0, "res/screens/KitchenScreen/StoreBrochure.png", "res/screens/KitchenScreen/StoreBrochureGlow.png", null,null, "Click", function(){
gameState.pubsub.publish("SwitchScreen", "MarketScreen");
gameState.storeVisits++;
} );
// If player did not buy a turkey, tell them
if( !gameState.turkeyBought ){
gameState.pubsub.publish( "ShowDialog", {seq:"PaintStory", autoAdvance:true} );
if( gameState.turkeyBought ){
gameState.pubsub.publish( "ShowDialog", {seq:"Spouse gets surprise movie tickets", autoAdvance:true} );
}
return {
@ -443,32 +446,6 @@ function ScoreScreen( stage, gameState ){ @@ -443,32 +446,6 @@ function ScoreScreen( stage, gameState ){
// Retry Button
}
function HelpScreen( stage, gameState ){
var that = this;
this.background = new createjs.Bitmap( "res/screens/HelpCreditsScreen/HelpP1P2.png" );
stage.addChild( this.background );
stage.addChild( new Button( stage, gameState, 698, 15, 80, 50,null, null, function(){
if( !gameState.gameStarted )
gameState.pubsub.publish("SwitchScreen", "MainScreen");
else
gameState.pubsub.publish("SwitchScreen", "KitchenScreen");
} ));
this.uiElems = [];
return {
blit : function(){
// Draw all the uiElements
for( var index in that.uiElems ){
that.uiElems[ index ].tick();
}
}
}
//
}
function CreditsScreen( stage, gameState ){
var that = this;

1
js/soundmanager.js

@ -27,6 +27,7 @@ function SoundManager( gameState ){ @@ -27,6 +27,7 @@ function SoundManager( gameState ){
createjs.Sound.registerSound("res/sound/Kitchen/Oven_Door_Full_Close.mp3", "Oven_Door_Full_Close");
createjs.Sound.registerSound("res/sound/Kitchen/Oven_Door_Peek_Close.mp3", "Oven_Door_Peek_Close");
createjs.Sound.registerSound("res/sound/Kitchen/Oven_Door_Peek_Open.mp3", "Oven_Door_Peek_Open");
createjs.Sound.registerSound("res/sound/Kitchen/sizzle.mp3", "Sizzle");
createjs.Sound.registerSound("res/sound/Kitchen/Open_Cookbook.mp3", "Open_Cookbook");
createjs.Sound.registerSound("res/sound/Kitchen/Close_Cookbook.mp3", "Close_Cookbook");

424
js/stories.js

@ -4,23 +4,423 @@ var messages = { @@ -4,23 +4,423 @@ var messages = {
"CannotBuyTurkey" : ["Me: I've barely have time for ONE turkey, let alone TWO!"],
"NoMoney" : ["Me: I can't afford this!"],
"BuyTurkeyFirst" : ["Me: I should buy a turkey first!"],
"BrokenLight" : ["Me: Hmm... the oven light appears to be broken..."],
"EmptyOven" : ["Me: Ah, the oven is already preheated..."],
"OpenDoor" :["Me: Hmm... I should probably try opening the oven door to measure the turkey's temperature"]
"OpenDoor" :["Me: I should probably try opening the oven door to measure the turkey's temperature"]
}
var story = {
"PaintStory" : ["Brother: Hey Grandpa, I've got a funny story about that primer you gave me",
"Grandpa: You'll have to remind me, again, my memory isn't too good in my old age",
"Duck Story":
["Dad: So I was in the office last week, typing up the TPS reports that need to be turned in every Friday, when I heard a quacking sound.",
"Dad: I thought it was Larry again. He has one of those old Blackintosh computers at his desk, you know, the ones with the smiley winking face.",
"Brother: Dad, that's such old technology. When is your company going to upgrade to SuckBox 87?",
"Dad: I know, but let me finish my story. Well, you know how when you click or an alert box comes up the computer can be set to a quacking sound?",
"Dad: So I tell Larry, what's up with all his alert boxes.",
"Mom: Who's Larry again hun?",
"Dad: He's my stall partner. We share he cubicle remember? So he turns around in his office chair, and asks 'what?'",
"Dad: 'The quacking, what's with all the quacking?'",
"Dad: 'I'm not doing it', he tells me.",
"Dad: 'Well, It isn't me.'",
"Dad: Just then the quacking noise happened again.",
"Dad: 'Did you hear that Larry?'",
"Dad: 'Yeah.'",
"Dad: We poked our head above the cubicle to look out and didn't see anybody else in the room. Yet the quacking came again.",
"Dad: Besides the quacking, the room had fallen very silent.",
"Mom: So, what did ya do?",
"Dad: I droop down on my hands and knees, and that's when it got me.",
"Mom: Mercy!",
"Brother: You got attacked by a duck?",
"Dad: That duck ran into me, face first. In its flight to escape, it pooped on my hands. Lucky me.",
"Dad: Larry and I grabbed a few guys on break and we corralled the duck out of the office.",
"Dad: Some of the guys wanted to keep it as a pet, but these are the same guys who don't get much done anyways. No help to office productivity.",
"Grandma: Son, You let a good meal go to waste.",
"Dad: Mom, we don't eat ducks we find on the street. That's just cruel.",
"Grandma: That doesn't stop those Chinese from eating street cats and dogs. Why do you think there are all those missing pet posters in the neighborhood?",
"Mom: Oh good lord!",
"Dad: Mom, you should stop spreading those rumors. It is cars and wild animals.",
"Grandma: Oh I'm sure those are SOME of the reasons. But lying to yourself isn't good honey.",
"Cat: Meow.",
"Dad: Oh hey Kasey. You like being an indoor cat don't you? Don't have to worry about all those cars and wild animals. Don't you little girl?",
"Grandma: And Chinese.",
"Dad: Mooom!"],
"Creeper Worker":
["Brother: ...and so this guy kept trying to see what I wrote down on my notepad, and I keep trying to hide it from his prying eyes. Anyways…",
"Dad: Hey that reminds me of this guy at work.",
"Brother: I'm trying to tell a story here Dad.",
"Mom: Let Greg finish.",
"Dad: Ok, finish your story.",
"Brother: Well… I forgot where I was going with it. Err, the guy was trying to view my notepad...and well, that's about it. Look what you did Dad.",
"Dad: Sorry. But hey! Now you can hear my story.",
"Dad: Just like you, we had a nosey co-worker. This co-worker was showing around a new customer to our branch when a screensaver caught his in a nearby room.",
"Grandma: What is a screensaver?",
"Dad: You know on a computer when you don't use it and the screen goes black? It is like that, except this computer has an animated display like a slide show.",
"Grandma: Ok, a slide show on the computer.",
"Dad: Yes, sort of like that.",
"Dad: Well, the co-worker enters the room, with the new customer, to check out the screen saver. Now this room belongs to Julia, our PR rep.",
"Dad: I'm not sure why he entered the room. He could have just viewed the screen saver through the office window.",
"Dad: Julia wasn't there at the time, but word gets around quickly in the office.",
"Dad: She found out that Rob, that's the co-worker, entered the room, and filed a complaint with Internal Relations.",
"Dad: Then Internal relations sends a message to Rob, asking if he did enter the room.",
"Dad: And then Rob sends a long email response back, all the while with our customer in tow, even asking the customer advice about what to include in the E-mail.",
"Brother: Wow, so did you lose the customer?",
"Dad: We don't know yet, but management did send an internal memo around re-affirming the boundaries of privacy.",
"Dad: This whole thing was completely overblown though. Rob was just looking at a screensaver. He didn't even try and hide it either.",
"Dad: But that's life. People who get excited over nothing.",
"Wife: Well, he did seem kind of creepy asking for the customer's advice on the E-mail.",
"Brother: And what about Julia? She seemed to know a littttle bit too much about the goings on in her office cubicle.",
"Dad: Maybe she has an office camera or something. I'm not sure.",
"Brother: Do you have one?",
"Dad: No, but then again I'm not in PR. Sometimes workers try and find out what the dirt is on them, or try and change their records on the computer.",
"Brother: Sorry to say, it honestly sounds like a terrible place to work.",
"Dad: It isn't as bad as it seems. Every now and then sometime like this happens and it becomes the talk of the town.",
"Brother: Maybe just a boring place."],
"Paint Bucket Sucks":
["Brother: Hey Grandpa, I've got a funny story about that primer you gave me.",
"Grandpa: You'll have to remind me again, my memory isn't too good in my old age.",
"Brother: Well, you gave me some primer to redo my room.",
"Mom: How is that going? Last I heard you had the priming done",
"Brother: Yup. Well, almost. I still have a mess to clean up",
"Mom: How is the painting going? Last I heard you had the priming done.",
"Brother: Yup. Well, almost. I still have a mess to clean up.",
"Mom: What happened?",
"Brother: Well, this can of primer was pretty old. And I guess it rusted on the bottom. So I prep everything, and get the primer can lid taken off, and start going to town on the wall. Then, I start feeling some wetness on my pants. I look down and there are primer drops all over my pants.",
"Dad: Why were you holding the paint bucket though. Don't you just pour it in a roller pan and do it that way like I taught you?",
"Brother: Well yes, but I was also cutting the edges, like you taught me. And that was easier with the paint bucket in my hand. Or so I thought...",
"Brother: Right. Well, umm so I quickly put the paint can down in the roller pan, seee, that I had nearby, and as I turned around to go clean myself off with some paper towels, I noticed a drip line all the way from the garage.",
"Brother: That's not good. So I dashed for the towels, and tried to soak up as much as possible. And well.. yeah So, in the future, I probably won't go for your primer Grandpa.",
"Grandpa: ..."]
"Brother: Yeaahh well, grandpa's can of primer was pretty old. And it rusted on the bottom and developed small holes.",
"Brother: So, there I was prepping everything, ready to go to town on the walls, when I start feeling some wetness on my pants.",
"Brother: I look down and there are primer drops all over my pants.",
"Dad: Why were you holding the paint bucket though? Don't you just pour it in a roller pan and do it that way like I taught you?",
"Brother: Well yes, but I was also cutting the edges of the room before hand, like you taught me. And that was easier with the paint bucket in my hand.",
"Brother: Or so I thought…",
"Mom: What happened next Greggy?",
"Brother: Mom, don't call me 'Greggy'.",
"Brother: Anywaaays, I quickly put the can down in the roller pan I had nearby. I turned around to find some paper towels to clean myself off with.",
"Brother: That's when I noticed a drip line all the way from the garage. That's not good.",
"Brother: I dashed for the towels and once I reached them, I tried to soak up as much as possible. And well... not good.",
"Brother: In the future, I probably won't go for your primer Grandpa.",
"Grandpa: You know what'll get that paint out? Some turpentine. If you don't have some of that handy you should try out some kerosene.",
"Brother: I tried some paint remover already, but it also took out the color in my pants. Luckily, I wasn't wearing my best pants.",
"Brother: I did have to go for a heavy duty carpet cleaning service. My wife wasn't too happy about that",
"Grandpa: You should have asked me for help. I would have shown you how to do it, and I would have done it for free too.",
"Brother: Thanks Grandpa, I'll definitely keep that in mind."],
"Hanging Doorway Ornaments":[
"Grandma: A real bother these days are the people that decorations in their doorways. They get in your face as you try to walk through.",
"Grandma: And what if there is an Earthquake!",
"Grandpa: It isn't like we live on a fault line.",
"Grandma: Just stop hanging your bears in the doorway.",
"Grandpa: I have the kitchen and you have the garage, that was the deal.",
"Grandma: Maybe I'll just take both the garage and the kitchen and then put you out on the street with your keychain bears.",
"Grandpa: I'd like to see you try.",
"Grandma: Oohh don't make me get my shotgun.",
"Grandpa: Err, speaking of kitchens. HOW IS THAT TURKEY COMING ALONG IN THERE. YOU NEED A HAND?"],
"Spouse gets surprise movie tickets":
["Mom: Hey, seen any interesting movies y'all?",
"Spouse: I have. Recently I was...",
"Grandpa: Back in my day, we burned rats for fun.",
"Spouse: errr.. Grandpa?",
"Grandma: Don't mind him. He's losing his mind.",
"Grandpa: I keep it right here. *Taps head* But where did you put the lock on that mouse of yours?",
"Dad: Dad, Mom, don't keep interrupting the story.",
"Grandpa: Well, she started it.",
"Grandma: Ahh, you old coot.",
"Mom: Please continue.",
"Spouse: ummmmm",
"Spouse: Ah, now I remember. [Player] and I were at the mall when a woman came up to us.",
"Spouse: 'Hey guys, sorry to bother you. I'm the host of a free movie screening preview, and we are trying to fill as many seats as possible.'",
"Spouse: 'We severely underestimated the number of people who were going to show up. If you have time, it would really help me out if you two would attend.'",
"Spouse: [Player] thought going to see the free movie was a no brainer, but I knew that we had somewhere to be in less than two hours.",
"Spouse: 'How long is the movie', I asked. She replied, 'About an hour and a half'. Which is about standard.",
"Grandpa: Back in my day...",
"Spouse: 'WE CAN ALWAYS leave early', [Player] whispered to me.",
"Dad: Did you end up seeing it?",
"Spouse: Actually, yes.",
"Spouse: We lined up at the theater, and noticed that all the others in line had a pamphlet ticket. We might be in the wrong line!",
"Spouse: The women told us to mention her name 'Stephanine' at the door to get in, but what if we go up to the doorman, mention 'Stephanine', and they respond ' Stephanine, who is Stephaine?' ",
"Spouse: The line begins to move, and we approach to the ticket-taker.",
"Spouse: 'Stephanie told us to come'. After a heart wrenching pause, the doorman nodded, and we were allowed in.",
"Dad: What movie was it?",
"Spouse: Stephanie mentioned it was going to be an action documentary about Poland but when we got our seats, the pre-ads were all childish.",
"Spouse: Legos, Toys, cartoons, etc. [Player] and I wondered if the movie we were about to see wasn't even what they told us.",
"Brother: Legos aren't just for kids.",
"Spouse: Maybe not, but the marketing is primarily kid focused. Anyhow, the movie turned out to be the Poland one.",
"Spouse: However, the movie was two hours rather than the expected one hour thirty.",
"Mom: Did you stay the whole time? I could not see myself walking out. I would feel too embarrassed about the whole audience staring at me.",
"Spouse: It isn't that hard, you just treat it like you are headed to the bathroom. Except you never come back.",
"Spouse: But yes, we did leave early, so we'll have to check the rest of the movie on DVD, or see it in theatres when it officially releases.",
"Mom: Good thing the staff didn't send a search party for you. Maybe you fell into the toilet",
"Spouse: Haha",
"Dad: Say, what was the title of the movie?",
"Spouse: 'Randy Staples Shares the Pain.' We saw all the build up, but missed the payoff.",
"Grandpa: Back in my day, we used to watch movies for a nickel.",
"Mom: I remember when gas used to be twenty cents a gallon.",
"Brother: And I remember when the PS3 cost $599 US dollars.",
"Cat: Meow, meow meow"],
"Youtube Sensation":
["Grandpa: Back in my day, we burned rats for fun.",
"Brother: Ok Grandpa. Anyways, I was at Frankfort mall the other day.",
"Brother: Just walking around, not really focused on any particular purchase when I noticed a long line. Naturally, you see the line, and wonder what's for.",
"Brother: So, my buddies and I walked up the line to find out the sitch.",
"Mom: What's a 'sitch'.",
"Brother: It means situation.",
"Mom: I see. How long was the line?",
"Brother: Oh, it stretched, maybe, half the mall. There were security guards out, to make sure that traffic could get through gaps in the line.",
"Brother: As we neared the front, we saw that the line moved into some kind of makeup store.",
"Brother: The flier outside said they had one of those video sensations, you know the one who does the makeup? I can't remember her name.",
"Mom: So did you go in?",
"Brother: And wait in that long line? I don't even wear makeup!",
"Mom: Yeah, but what about your fiancée'? Why not get her something nice?",
"Brother: I'm sure she would love some makeup, but I can buy that stuff on any day.",
"Brother: One kind of interesting, but obvious, thing about the line composition was that it was majorly women. There was a handful of guys, but I'd assume they were boyfriends.",
"Grandpa: Back in my day, I would have gotten in that line and wooed all the women.",
"Grandma: You can't even grab the attention of a taxi.",
"Grandpa: You're not making sense. Why would I want to take a taxi out to dinner?",
"Grandma: No, not taking a taxi out to dinner. Forget it. Just forget it."],
"Girlfriend's Boba Keeps on a-flowing":
["Girlfriend: You know what boba is right Mom?",
"Mom: What's Boba?",
"Girlfriend: Ok, I guess not.",
"Grandma: What's booba?",
"Girlfriend: I take it you mean boba?",
"Grandma: Yes, that thing.",
"Girlfriend: What most people talk about when they mean 'boba' are tea drinks with milk in them.",
"Girlfriend: The boba tea drinks are not hard to make, just make black tea, and then add any kind of milk you have, some sweetener, then chill with ice.",
"Girlfriend: [Player] and I made it at home one time, but that's another story. Anyways, the 'boba' itself are these little black balls that are made out of sweet potato.",
"Dad: Sweet Potatoes, like a yam?",
"Brother: Dad, you know that sweet potatoes and yams are not the same right?",
"Dad: What? They aren't?",
"Brother: No",
"Dad: Well, what's the difference?",
"Brother: I don't know, but the point is they are different.",
"Girlfriend: Boba is usually made from sweet potatoes, but it can also be made from other starchy materials, I suppose.",
"Dad: What's it taste like? Kind of...potatoey?",
"Girlfriend: Not really, it is chewy, a bit like... when you take the first bite into some gum. Right before it gets soft.",
"Girlfriend: Though when places heat it up, it is really soft and moldable.",
"Grandma: Hmm. I wouldn't mind trying this boba sometime.",
"Girlfriend: You definitely should since I know you like your morning tea.",
"Girlfriend: Now that you all know what boba is, I can tell you about this cool, and somewhat awkward event that happened.",
"Girlfriend: [Player] and I were driving down the freeway when we remembered that a new boba place was opening up on Teller St.",
"Girlfriend: As part of their opening promotion, they were offering one free boba drink per customer.",
"Girlfriend: Since I was thirsty, I suggested we drop by and see what's up.",
"Girlfriend: We parked and walk up to the building. There weren't too many people about, and a sign revealed why.",
"Girlfriend: The free boba promotion ended at 8PM, and it was already 10!",
"Mom: Aww, that's too bad",
"Girlfriend: I decided to get a drink anyways.",
"Girlfriend: But when I ordered, the worker said 'Would you like to try one of our free drinks?', and motioned towards the sign",
"Girlfriend: 'Sure!', Then he asked [Player] what [GenderPronoun] wanted.",
"Girlfriend: So we both got a full-sized free drink!",
"Mom: What flavor did you get? I assume there are flavors of boba?",
"Girlfriend: Yes, there are. I ordered Strawberry. It tasted ok, but was really missing that strawberry flavor.",
"Girlfriend: The worker asked how they were, and well Mom, you raised me to be an honest individual, so it was lacking in flavor.",
"Girlfriend: So the worker says, 'Alright, let me make you another one'",
"Girlfriend: He makes me a completely new boba drink, while letting me keep the old one to drink. At this point I haven't even paid for anything yet",
"Dad: That's just good customer service. Since this place is new, he is trying to build up customer relations.",
"Girlfriend: True, but I feel like it got a little out of hand. The next drink also lacked the strawberry flavor. The worker said it is probably because of the syrup.",
"Girlfriend: He then proceeded to make another drink, still free, using fresh strawberries in lieu of the syrup flavoring.",
"Girlfriend: Now the syrup drinks were probably really cheap to make, but making drinks with real fruit costs considerably more.",
"Girlfriend: By the end of our time at the place, the two of us had six drinks in hand without a cent spent.",
"Girlfriend: The worker just kept offering us samples and I felt really guilty about being so honest.",
"Girlfriend: I decided to order the drink I was originally going to get, even though I had consumed 2 whole boba drinks already. Sugar overload!",
"Brother: I hope you left him a fat tip for his troubles.",
"Girlfriend: Yes, I tipped, [Player] made sure of that.",
"Girlfriend: With all the caffeine and sugar, I couldn't sleep all night. My heart was in trepidation even through the next morning.",
"Girlfriend: I probably wouldn't do that again.",
"Grandma: This sounds like the place I should try my first boba.",
"Girlfriend: I don't think I could boba for at least a month I'm so burnt out.",
"Brother: It is settled, right after this meal we're all going out for boba.",
"Girlfriend: Hah, no.",
"Brother: No, seriously.",
"Girlfriend: And seriously. No"],
"Grandmother reveals the virtues of the bread line":
["Brother: The Turkey is taking a while to cook. [Player] isn't too good at cooking is [GenderPronoun]?",
"Girlfriend: How dare you talk about [Player] he is a great cook. Sometimes. Well, you'll see!",
"Grandma: You guys have it lucky. Where I grew up we had bread lines.",
"Grandma: My family would stand in a bread line for over six hours with the POSSIBILITY of receiving a loaf of bread.",
"Grandma: I remember one particular occasion where my mom told me to take my baby sister with me and go stand in the bread line.",
"Grandma: I was only 8 years old, and my baby sister was less than a year.",
"Grandma: Standing is a whole day affair. Some people brought laundry. Others did their crafts in line.",
"Grandma: My sister and I stood in that line together for over eight hours until we finally reached the front.",
"Grandma: When we got there. The man with the bread said, 'One loaf of Bread.'",
"Grandma: I held my baby sister outstretched and said 'Two.'",
"Grandma: The bread man responded. 'Baby doesn't count. One loaf of bread.' We were then pushed out of line with our one loaf.",
"Mom: Jesus, that sounds horrible.",
"Grandma: It was, but it was also necessary. Though when I hear people complaining how they are tired of waiting, I like to retell that story.",
"Brother: Alright, I suppose it could be worse, but let's hope that [Player] can do better than that."],
"Father talks about the virtues of Automated Cars":
["Mom: Roger, tell everyone about your automated cars meeting.",
"Dad: It wasn't a meeting, it was closer to a seminar.",
"Dad: At work, we accrue credits that can be put towards educational events. Our managers think that an educated workforce is a happy and productive workforce.",
"Dad: So we are required to spend these credits every year on our choice of relevant education events.",
"Girlfriend: That's cool. What kind of choices for educational events are there?",
"Dad: As one example, employees can go to a local college or high school and present about their work at the company.",
"Dad: Other options are to attend talks about various topics, such as aerospace engineering, materials science, manager relations, customer relations, etc.",
"Dad: I decided to spend my credits on a five person panel from the various automotive manufacturers about the future of automated vehicles.",
"Dad: Disappointingly, the panel never went in-depth about the technology side of automated cars.",
"Dad: The panel just already affirmed what I already knew. Self-driving cars are coming.",
"Grandpa: Why would you want a self-driving car anyways? Driving is fun!",
"Grandpa: I remember driving my old station wagon across country to California. Now that was a trip to remember.",
"Grandpa: The sun was beating down, and we didn't have air conditioning in the car, so you rolled down the window and enjoyed the breeze.",
"Grandpa: Nowadays, you are spoiled with automatic windows, automatic car washers, automatic transmission.",
"Grandpa: Why even call it a car? Sounds to me more like a train you ride.",
"Dad: Yes Dad, which was the general gist of the whole thing. Some people like to drive their car.",
"Dad: Though one panelist seemed confident that it will eventually take over.",
"Dad: They quoted 48 minutes as the average amount of time a driver spends in their car per day.",
"Dad: If most of that time is spent in traffic, or just getting somewhere, then people will adopt a car that can do the nitty gritty driving.",
"Dad: Drivers can then spend their five leisure minutes on the beach boulevard cruising with manual control.",
"Grandpa: Enjoy your fandangled self-driving cars, if they ever come.",
"Grandpa: In the 1960s they used to say we'd have flying cars in the 2000s, but you don't see that now.",
"Brother: Maybe in my generation. First the self-driving cars, then the flying ones.",
"Cat: Meow (and then the world!)"],
"Brother recounts a hockey game he saw recently, and his friend has to go to the hospital":
["Brother: Yo, I watched a hockey game recently. There were cheap group tickets, so a bunch of my friends jumped on it to watch the game.",
"Girlfriend: Who was playing?",
"Brother: Some minor league team, the 'Raging Tornados', I believe? It isn't important. The point is seeing two teams pummel each other over a little puck.",
"Grandpa: Yes, exactly!",
"Girlfriend: I suppose since we're glorifying the violence of the sport, were there any fights?",
"Brother: Ah hell yeah! The gloves were thrown to the ice, and the two players starting man-hugging each other.",
"Brother: The refs just let it go. There was no blood, but it was the intention that mattered.",
"Brother: Sadly, it isn't like some video games where the winner of the fight gets to stay on the ice. The perpetrator in this case got the penalty.",
"Brother: But anyways, what was cool was we were allowed to play some broomball on the ice before the game due to our group size.",
"Brother: That was loads of fun. Until someone got injured.",
"Mom: Heavens no!",
"Brother: Well, it wasn't from the broomball.",
"Brother: Later, when our group was walking around, waiting for the actual game to start, the two hockey teams were practicing and a puck flew into the crowd.",
"Brother: It smacked one of my friends in the neck, and they had to go to the infirmary.",
"Mom: But were they okay?",
"Brother: Yeah, they were fine. They decided to go home however. Too much trauma. They would be flinching with every one-timer during the game.",
"Mom: Aww, that's a shame. It wasn't Charles was it? Poor Charles...",
"Brother: No, Mom, Charles is fine.",
"Girlfriend: Close game?",
"Brother: Hardly. 3-0",
"Brother: The tornado mascot kept it interesting though, with his kazoo.",
"Brother: 'Bzzzwoooooo'",
"Brother: Ah, here's something. A Catholic girl's school came to sing the national anthem.",
"Brother: You have to imagine these girls were about five to six years old. So it was mind-numbingly cute.",
"Brother: The stadium was filled with 'awwws' when they approached the mics.",
"Brother: Well anyways, these girls were out near the mechanical bull before the game started.",
"Dad: The stadium has a mechanical bull?",
"Brother: Yup, pay your five dollars and take it for a ride. The operators know their clientele.",
"Brother: They let young kids 'tame the bull' while they throw the wrath of God down on the teenagers. Cause they know the teens want to flex their muscle.",
"Brother: I watched one teen tumble backwards over his head and shoulders in one bout.",
"Brother: The best part though was those little girls I mentioned earlier.",
"Brother: They surrounded the bull-riding-rink, all dressed in their school outfits.",
"Brother: 'Ride the bull. Ride the Bull!', They shouted in unison.",
"Brother: Then when someone got on.",
"Brother: 'Make them fall, make them fall!'",
"Mom: Dawwww",
"Brother: No Mom! Those little girls are evil!",
"Brother: But, it was definitely a lot of fun to watch."],
"Mom talks about her students and reading over summer vacation":
["Girlfriend: Well Mom, how are your students doing?",
"Mom: Thank you for asking. They are doing well.",
"Brother: Still teaching the third grade?",
"Mom: Yessum",
"Girlfriend: Soo, lay on the juicy stories.",
"Mom: Mmmm, well, for the winter break coming up I'm planning on having them read 'The BFG'.",
"Girlfriend: oooh, I liked that book.",
"Brother: Mom, winter break reading is THE reason that students hate their teachers. Can't you let them enjoy their break in peace?",
"Mom: But reading is fundamental. We can't let our students forget what they learned.",
"Girlfriend: It isn't that bad, 'The BFG' is a fun and entertaining book.",
"Brother: Granted, but forcing one to read kills their love of reading. It did for me.",
"Brother: After I began reading for fun rather than the school forcing me to do it, I could really appreciate the work for what they are.",
"Mom: Greg, you are right. But you have to remember that if we don't force kids to do a little reading, they may not do the reading at all.",
"Mom: I sleep better knowing that my students have been given the opportunity discover works they like, whether or not a little encouragement was given.",
"Brother: You are an inspiration to us all.",
"Mom: That's very kind of you to say."],
"Grandmother reveals her name":
["Grandpa: Lana, did I ever tell you that I am blessed to be married to you?",
"Grandma: Well, you just know all the right things to say to make a woman feel good.",
"Brother: Grandma, if you don't mind me asking, I was wondering if your name, 'Lana' had any special meaning in Russian.",
"Brother: Like, I know some American names, like Mark, are biblical in nature.",
"Grandma: Ahh, well yes. Very similar",
"Grandma: Lana is short for Svetlana, which was my given name. I shortened it to 'Lana' because it was easier to pronounce in those parts.",
"Brother: Sweatlana?",
"Grandma: Close, but you need to put more 'V' into it.",
"Grandma: Stalin's daughter was named Svetlana, and so many mothers named their daughters the same in honor.",
"Grandma: It was be loosely translated to light, and holy. Sort of biblical as you mentioned.",
"Brother: That's very interesting. Mom, Dad, was there any special reason for naming me Greg?",
"Mom: Well.",
"Dad: We looked at a lot baby naming books, and we were having trouble deciding.",
"Mom: I had a good friend named Greg when I was growing up so I liked that name.",
"Dad: It sounded good to me, and you ended up a boy, so it worked out.",
"Brother: So, did the 'Greg' you knew Mom, do anything special or notable? Like, was he famous?",
"Mom: Uhhh, well, we dated for a while, but it didn't work out.",
"Brother: Whaat? I'm named after your former lover?! Did you know about this Dad?!",
"Dad: Yes, but what's the big deal? I still like the name Greg. It's a good strong name.",
"Brother: I don't think I'll be able to think about my name the same way ever again.",
"Girlfriend: Hah ha brother. Sucks to be you. Hah ha!",
"Girlfriend: But please Mom and Dad, don't tell ever me how I got my name.",
"Mom: Ooh, but your name origin is quite special.",
"Girlfriend: La la la, I'm not listening!"],
"Grandparents sings a Patriotist song":
["Grandpa: Since dinner is taking a while, it seems like a good time for a song don't you think?",
"Dad: Dad, please no…",
"Grandpa: Ooooh, I saw Mussolini sitting on a log",
"Grandpa: All puffed up like a great big frog",
"Grandpa: Sneaked up close and stuck him with a wire",
"Grandpa: And he just went poof like an old flat tire.",
"Grandpa: took his hide and hung it on a tree,",
"Grandpa: and he said 'hey don't do that to me' ",
"Grandpa: so I took it on home to my mother in law",
"Grandpa: She threw me outside with the Turkey in the Straw",
"Grandma: Oooooh Adolf Hitler grabbed a tail, ",
"Grandma: And he hung right on with tooth and nail, ",
"Grandma: and he saw what he had and he began to swear, ",
"Grandma: On the end of the tail was a Russian bear, ",
"Grandpa: The old bear growled and started in to shake, ",
"Grandma: Adolf knew he'd made a big mistake.",
"Grandpa: He tried to hang on and he tried to let go ",
"Grandma: Now they have a new dance called Hitler in the snow. ",
"Grandpa: Wow, I didn't know you knew that one. ",
"Grandma: Word travels fast on the front. Just don't let the officers hear you singing it or they'll whoop your ass faster than you can say водка. ",
"Grandpa: Advice to keep close at heart. "],
"Dad Tells a bad Joke":
["Dad: Hey guys, what's the key to a great Thanksgiving dinner?",
"Mom: Of course it is the loving family?",
"Brother: I bet it is the pillowy mounds of mashed potatoes.",
"Girlfriend: It is the turkey right?",
"Dad: That's right, its the turKEY",
"Dad: turKEY, get it?",
"Girlfriend: What?",
"Dad: The KEY to a great thanksgiving dinner is the turKEY.",
"Girlfriend: Aww, come on Dad. That's terrible.",
"Grandma: Is this a joke?",
"Dad: Yes Mom,",
"Grandma: Well, what do you mean 'key' .",
"Dad: A 'key', something that is of vital importance.",
"Grandma: hmmm, ok. I think I get it.",
"Dad: Ok…."],
"Mom Story":
["Mom: My favorite color is butter.",
"Girlfriend: That's cool."],
"Cat Story":
["Cat: Meow Meow Meow Meow Meow",
"Dad: I think the cat's hungry!",
"Cat: Meow",
"Mom: Look at it, poor thing wants some turkey!",
"Cat: Meow",
"Cat: (Translation) If you turn the oven past 1000 degrees, something fun happens!"],
"Cat Story II":
["Cat: Meow Meow Meow!",
"Mom: What is it, sweetie?",
"Cat: Meow Meow Meow!",
"Cat: (Translation) Why aren't we cooking fish? I want fish for dinner.",
"Mom: Yes sweetie, that's an oven with a turkey inside! We're going to have a nice dinner.",
"Cat: Meow",
"Cat: (Translation) It's like you don't love me anymore.",
"Mom: It'll be done very soon, I promise! You can have a few bites.",
"Cat: Meow Meow Meow Meow!",
"Cat: (Translation) I don't want turkey, I want fish!"]
};

103
js/ui.js

@ -44,6 +44,77 @@ function ClockUI( stage, gameState ){ @@ -44,6 +44,77 @@ function ClockUI( stage, gameState ){
}
function HelpUI( stage, gameState ){
var that = this;
this.showingHelp = false;
var helpPages = [
new createjs.Bitmap("res/screens/HelpCreditsScreen/HelpP1P2.png"),
new createjs.Bitmap("res/screens/HelpCreditsScreen/HelpP3P4.png"),
new createjs.Bitmap("res/screens/HelpCreditsScreen/HelpP5P6.png"),
new createjs.Bitmap("res/screens/HelpCreditsScreen/HelpP7P8.png")
];
var position = 0;
var helpImg = helpPages[0];
var closeButton = new Button( stage, gameState, 708, 8, 80, 50,null, null, function(){ that.hideHelp(); } );
var nextButton = new Button( stage, gameState, 645, 543, 80, 50, null,null, function(){ gameState.pubsub.publish("Play", "Open_Cookbook");
if( helpImg ){
position++;
helpImg.visible = false;
helpImg = helpPages[ position % 4 ];
helpImg.visible = true;
} else{
that.hideHelp();
}
});
var prevButton = new Button( stage, gameState, 77, 546, 80, 50, null,null, function(){ gameState.pubsub.publish("Play", "Open_Cookbook");
if( helpImg ){
position--;
helpImg.visible = false;
helpImg = helpPages[ Math.abs(position) % 4 ];
helpImg.visible = true;
} else {
that.hideHelp();
}
});
stage.addChild( this.background );
stage.addChild( closeButton );
this.hideHelp = function(){
helpImg.visible=false;
stage.removeChild( closeButton );
stage.removeChild( nextButton );
stage.removeChild( prevButton );
for( var i in helpPages ){
helpPages[i].visible = false;
stage.removeChild( helpPages[i] );
}
that.showingHelp = false;
gameState.pubsub.publish("Play", "Close_Cookbook");
}
// Show core temperature
this.showHelp = function(){
if( that.showingHelp ) return;
gameState.pubsub.publish("Play", "Open_Cookbook");
for( var i in helpPages ){
helpPages[i].visible = false;
stage.addChild( helpPages[i] );
}
helpPages[0].visible = true;
stage.addChild( closeButton );
stage.addChild( nextButton );
stage.addChild( prevButton );
that.showingHelp = true;
}
// change temperature, this one's for the UI
gameState.pubsub.subscribe( "ShowHelp", this.showHelp );
}
function CookbookUI( stage, gameState ){
var that = this;
this.showingCookbook = false;
@ -190,10 +261,9 @@ function OvenUI( stage, gameState ){ @@ -190,10 +261,9 @@ function OvenUI( stage, gameState ){
this.ovenLightToggle = function(){
lightPressedImg.alpha = lightPressedImg.alpha == 0 ? 1 : 0;
// Only work if the user bought an oven light
if( gameState.boughtOvenLight ){
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;
@ -204,10 +274,6 @@ function OvenUI( stage, gameState ){ @@ -204,10 +274,6 @@ function OvenUI( stage, gameState ){
doorPeekLightOff.alpha = lightPressedImg.alpha == 0 ? 1 : 0;
doorOpen.alpha = 0;
}
}else{
// say it only once
if( lightPressedImg.alpha == 1)
gameState.pubsub.publish( "ShowDialog", {seq:"BrokenLight", autoAdvance:true} );
}
}
@ -256,8 +322,8 @@ function OvenUI( stage, gameState ){ @@ -256,8 +322,8 @@ function OvenUI( stage, gameState ){
function ovenPeek(){
if( that.ovenDoor == OVEN_CLOSED && that.ovenDoor != OVEN_OPEN ){
gameState.pubsub.publish( "Play", "Oven_Door_Peek_Open" );
doorPeekLightOn.alpha = lightPressedImg.alpha == 0 ? 0 : 1;
doorPeekLightOff.alpha = lightPressedImg.alpha == 0 ? 1 : 0;
doorPeekLightOn.alpha = lightPressedImg.alpha;
doorPeekLightOff.alpha = !lightPressedImg.alpha;
doorClosedLightOn.alpha = 0;
doorClosedLightOff.alpha = 0;
doorOpen.alpha = 0;
@ -268,11 +334,12 @@ function OvenUI( stage, gameState ){ @@ -268,11 +334,12 @@ function OvenUI( stage, gameState ){
var state = ovenModel.getTurkeyState();
gameState.pubsub.publish( "ShowDialog", {seq:"custom", autoAdvance:false, customText:"Looks " + turkeyState["skin"]["cond"][2] } );
gameState.pubsub.publish( "AddRecord", {type:"Peek ", text:"The turkey looked " + turkeyState["skin"]["cond"][2]} );
that.ovenOpened++;
}
}
else if (that.ovenDoor == OVEN_PEEK){
doorClosedLightOn.alpha = lightPressedImg.alpha == 0 ? 0 : 1;
doorClosedLightOff.alpha = lightPressedImg.alpha == 0 ? 1 : 0;
doorClosedLightOn.alpha = lightPressedImg.alpha;
doorClosedLightOff.alpha = !lightPressedImg.alpha;
doorPeekLightOn.alpha = 0;
doorPeekLightOff.alpha = 0;
that.ovenDoor = OVEN_CLOSED;
@ -291,6 +358,7 @@ function OvenUI( stage, gameState ){ @@ -291,6 +358,7 @@ function OvenUI( stage, gameState ){
state = ovenModel.getTurkeyState();
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"} );
that.ovenOpened++;
}
}
@ -307,8 +375,9 @@ function OvenUI( stage, gameState ){ @@ -307,8 +375,9 @@ function OvenUI( stage, gameState ){
this.secondTick = function(diff){
// check if oven door is open
if( that.ovenDoor == OVEN_OPEN ){
// - 25 + penalty 5 degrees a second for opening the oven.
// incur -25 + penalty 5 degrees a second for opening the oven.
}
ovenModel.secondTick();
gameState.currentTime += diff;
}
@ -325,10 +394,9 @@ function OvenUI( stage, gameState ){ @@ -325,10 +394,9 @@ function OvenUI( stage, gameState ){
tick: function(){
// IMPORTANT: SECOND TIMER
var diff = Date.now() - gameState.oldTime;
if( diff > 10000 ){
gameState.oldTime = Date.now();
var dialoguediff = Date.now() - gameState.oldDialogueTime;
if( diff > 1000 ){
that.secondTick( diff );
console.log(new Date( gameState.currentTime) );
if( gameState.turkeyBought ){
@ -346,6 +414,11 @@ function OvenUI( stage, gameState ){ @@ -346,6 +414,11 @@ function OvenUI( stage, gameState ){
if( turkeyState["skin"]["cond"][0] == "House Fire" )
turkeyStates[4].alpha = 1;
}
gameState.oldTime = Date.now();
}
if( gameState.turkeyBought && dialoguediff > 60*1000 ){
gameState.pubsub.publish( "ShowDialog", {seq:"Spouse gets surprise movie tickets", autoAdvance:true, random:true} );
gameState.oldDialogueTime = Date.now();
}
},
render: function(){
@ -656,7 +729,7 @@ function Button( stage, gameState, x_orig, y_orig, x_dest, y_dest, eventCmd, arg @@ -656,7 +729,7 @@ function Button( stage, gameState, x_orig, y_orig, x_dest, y_dest, eventCmd, arg
var button = new createjs.Shape();
button.graphics.beginFill("#ffffff").drawRect(x_orig, y_orig, x_dest, y_dest);
button.alpha = 0.01;
button.alpha = 0.5;
button.addEventListener( "click", function(){
gameState.pubsub.publish( "Play", "Click" );
if( !altfunc ){

BIN
res/screens/.DS_Store vendored

Binary file not shown.

BIN
res/screens/HelpCreditsScreen/.DS_Store vendored

Binary file not shown.

BIN
res/sound/.DS_Store vendored

Binary file not shown.

BIN
res/sound/Events/.DS_Store vendored

Binary file not shown.

BIN
res/sound/Kitchen/.DS_Store vendored

Binary file not shown.

BIN
res/sound/Kitchen/sizzle.mp3

Binary file not shown.
Loading…
Cancel
Save