Compare commits

...

65 Commits

Author SHA1 Message Date
Robert Chen 38b30e23d1 Merge pull request #12 from fernjager/Load_Fix1 10 years ago
Robert Chen c32af7c431 Allow loading CreateJS over HTTPS 10 years ago
Zott820 150fc28435 Update screens.js 10 years ago
Robert Chen 1bc0788752 Merge pull request #3 from fernjager/dialogueChanges 11 years ago
Zott820 5b0a60815c Update ui.js 11 years ago
Zott820 23a9b78633 Update screens.js 11 years ago
Robert Chen 13afa12307 Update README.md 11 years ago
Robert Chen 7ea13ab753 Update README.md 11 years ago
Robert Chen 4023f6f150 Dialogue rewording 11 years ago
Robert Chen 9efe75e0ce Fixed skybug 11 years ago
Robert Chen 39a5674e42 Merge pull request #2 from fernjager/dialogueChanges 11 years ago
Robert Chen 918907c2e8 Matlab simulation file 11 years ago
Zott820 ef6fdbaf90 Update stories.js 11 years ago
Zott820 ef9a3a1921 Added extra end Periods 11 years ago
SheenKao edae9ee63a Update README.md 11 years ago
Robert Chen 32f291a3c0 Score bugfix and death condition 11 years ago
Robert Chen 2f87b7cd90 Update README.md 11 years ago
Robert Chen 58e5b35364 Score tweaks, bug fixes 11 years ago
Robert Chen 9cc608e406 Less prone to fire 11 years ago
Robert Chen ffe8f5febf Fixed cook state ranges 11 years ago
Zott820 f5b4bee126 Update README.md 11 years ago
Robert Chen cc065837c6 Fix help pages bug 11 years ago
Zott820 db4a3c78ac Update README.md 11 years ago
Zott820 894df796db Update README.md 11 years ago
Robert Chen 3e273827bb Updated credits screen 11 years ago
Robert Chen 85be74cc83 Cookbook page update 11 years ago
Robert Chen 4dbd98a618 Updated help pages 11 years ago
Robert Chen ccd0b1ceed Bugfixes on scoring and modifier percentage 11 years ago
sakerfalcon 0e37a1d441 Update README.md 11 years ago
sakerfalcon 3f8f4b4162 Update README.md 11 years ago
sakerfalcon 29c75b2f6f Update README.md 11 years ago
sakerfalcon fc923abb8a Update README.md 11 years ago
sakerfalcon c4f71c1436 Update README.md 11 years ago
sakerfalcon 318bb5afda Update README.md 11 years ago
sakerfalcon 14014f6156 Update README.md 11 years ago
sakerfalcon e5617df6ef Update README.md 11 years ago
Robert Chen fb92860175 fixed modifier 11 years ago
Robert Chen be8ce4c28d Temperature loss, refined model 11 years ago
Robert Chen c16976a691 createjs 11 years ago
Robert Chen 47d6ead344 updated model 11 years ago
Robert Chen 56bcde6458 Missing image 11 years ago
Robert Chen cbd9738a6d Fix streetlight and turkey model 11 years ago
Robert Chen c2d9bc6e6d Add stars and mountains 11 years ago
Robert Chen 690c8be1fb Scrolling logbook 11 years ago
Robert Chen 5f1b4e59e4 Restore streetlight alpha 11 years ago
Robert Chen 281e007ca9 FPS issue workaround. Fix dialogue 11 years ago
Robert Chen 5d9373e688 Switch to alpha 11 years ago
Robert Chen 7d6da51451 Fixed tree animation 11 years ago
Robert Chen 553a303bf2 Lights for houses 11 years ago
Robert Chen 455d9e6e21 Fix naming nd keyboard events 11 years ago
Robert Chen b66d307b6e Update README.md 11 years ago
Robert Chen 7381f55699 Update README.md 11 years ago
Robert Chen 49ad605a46 Streetlight layering 11 years ago
Robert Chen 77ca3dbc59 Replace SVGs with PNGs 11 years ago
Robert Chen 7441e3b182 Pre-load buttons and text for the difficulty screen 11 years ago
Robert Chen 5d3920e069 Revert useless conditions 11 years ago
Robert Chen 5a8473c21d Restore click, but only at 100% 11 years ago
Robert Chen b539104f59 Fix loading, remove unused asset 11 years ago
Robert Chen 8e975c3d99 Removed unused file, duplicate 11 years ago
Robert Chen 6dff033fe7 Only let player enter after we load 100% 11 years ago
Robert Chen a2abc33f67 Accents 11 years ago
Robert Chen f1c12f87ca Actually replace placeholders 11 years ago
Robert Chen 10766bb687 Fixed dialog issue 11 years ago
Robert Chen 629d7a10d1 Grammar 11 years ago
Robert Chen 515352a562 Last minute contributions added to the credit screen 11 years ago
  1. 36
      README.md
  2. 2
      index.html
  3. 17
      js/dialogue.js
  4. 29
      js/main.js
  5. 320
      js/model.js
  6. 48
      js/screens.js
  7. 1
      js/soundmanager.js
  8. 212
      js/stories.js
  9. 186
      js/ui.js
  10. BIN
      res/screens/HelpCreditsScreen/Credits.png
  11. BIN
      res/screens/HelpCreditsScreen/HelpP1P2.png
  12. BIN
      res/screens/HelpCreditsScreen/HelpP3P4.png
  13. BIN
      res/screens/HelpCreditsScreen/HelpP5P6.png
  14. BIN
      res/screens/HelpCreditsScreen/HelpP7P8.png
  15. BIN
      res/screens/HelpCreditsScreen/HelpP9P10.png
  16. BIN
      res/screens/KitchenScreen/Cookbook-Open.png
  17. BIN
      res/screens/KitchenScreen/TurkeyState1Small.png
  18. BIN
      res/screens/KitchenScreen/TurkeyState2Small.png
  19. BIN
      res/screens/KitchenScreen/TurkeyState3Small.png
  20. BIN
      res/screens/KitchenScreen/TurkeyState4Small.png
  21. BIN
      res/screens/KitchenScreen/TurkeyState5Small.png
  22. BIN
      res/screens/Window/Housefar.png
  23. BIN
      res/screens/Window/Stars.png
  24. BIN
      res/screens/Window/Test4-217.png
  25. BIN
      res/screens/Window/Test4TransparencyFull.png
  26. 76
      sim/TurkeySimulation.m

36
README.md

@ -2,9 +2,9 @@ @@ -2,9 +2,9 @@
## Overview
It is another Thanksgiving holiday, a time of retrospect and blessings.
You have been invited over for dinner.
Wanting to make a good impression, you agree to cook the turkey…
It is another Thanksgiving holiday, a time of retrospection and blessings.
You have been invited to craft the centerpiece of the American thanksgiving dinner, the turkey. Woo your girlfriend / boyfriend and be judged by your future in-laws! Apply your culinary expertise to impress your family!
## Turkey Cooking Simulator Features:
* Real-time cooking action!
@ -12,23 +12,24 @@ Wanting to make a good impression, you agree to cook the turkey… @@ -12,23 +12,24 @@ Wanting to make a good impression, you agree to cook the turkey…
* Hours of gripping stories and drama!
* Accessorize your turkey with stuffing, frills, and other awesomeness!
* Day-night environmental cycle!
* High-definition stereo audio!
* High-fidelity stereo audio!
* Masterfully crafted scenes of an American household!
* Apply your culinary expertise to impress your family!
## Compatibility
* [Firefox](www.firefox.com) - Recommended Browser, Gstreamer required for sound on Mac OS
* [Chrome 22](https://www.google.com/intl/en/chrome/) - Full compatibility, recommended browser.
* [Safari 6.0.5](http://www.apple.com/safari/) - Some incompatibility with SVG
* [Internet Explorer 11](http://windows.microsoft.com/en-us/internet-explorer/download-ie) - Not recommended . Sound looping issues
* [Safari 6.0.5](http://www.apple.com/safari/) - Full compatibility, recommended browser.
* [Firefox 25](http://www.mozilla.org/en-US/firefox/new/) - Playable. [GStreamer] (http://gstreamer.freedesktop.org/) required for sound on Mac. Sound only plays once on Windows
* [Internet Explorer 11](http://windows.microsoft.com/en-us/internet-explorer/download-ie) - Not recommended. Sound looping issues.
## Open Source!
* Uses the CreateJS library for HTML5 Canvas: https://github.com/CreateJS/
## Authors
* [Robert J. Chen](http://fernjager.net) - Programming
* [Benjamin Kwok](mailto:tengen1112@gmail.com) - Art
* [Scott R. Mobley](http://www.linkedin.com/in/mobleyscott) - Math and Dialogue
* Sheen Kao - Supreme Commissar Overlord MC
* [Scott R. Mobley](http://www.linkedin.com/in/mobleyscott) - Turkey Overlord and Master of Dialogue
* [Robert J. Chen](http://fernjager.net) - Javascript Wizard
* [Benjamin Kwok](mailto:tengen1112@gmail.com) - Unpaid Art Peasant
* Sheen Kao - Finite Elementalist Supreme
## Backup Mirror
* http://fernjager.net/game/index.html
@ -36,7 +37,10 @@ Wanting to make a good impression, you agree to cook the turkey… @@ -36,7 +37,10 @@ Wanting to make a good impression, you agree to cook the turkey…
## Licenses and Credit
![CC](http://i.creativecommons.org/l/by-nc/3.0/88x31.png)
* Unless indicated otherwise in the credits page, all artwork are licensed under the Creative Commons Attribution-NonCommercial BY-NC by Benjamin Kwok.
* See credits screen for full attribution of sound assets
* Unless indicated otherwise in the credits page:
* All original artwork and writing are licensed under the Creative Commons Attribution-NonCommercial BY-NC
* Artwork: Benjamin Kwok.
* Writing: Scott Mobley.
* Source code is released under GPL v3 by Robert Chen.
* See credits screen for full attribution of all assets.

2
index.html

@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@
</div>
</center>
</body>
<script src="http://code.createjs.com/createjs-2013.09.25.min.js"></script>
<script src="//code.createjs.com/createjs-2013.09.25.min.js"></script>
<script src="js/model.js"></script>
<script src="js/soundmanager.js"></script>
<script src="js/stories.js"></script>

17
js/dialogue.js

@ -65,6 +65,10 @@ function DialogUI( stage, gameState ){ @@ -65,6 +65,10 @@ function DialogUI( stage, gameState ){
this.textContent.addEventListener( "mouseout", function(){ document.body.style.cursor='default'; } );
this.textContent.addEventListener( "click", function(){ setTimeout( clickEvent, 100); });
// negate double setTimeout if clicked
var oldTime = new Date().getTime();
var delayCounter = 0;
this.endFunc = function(){};
this.showDialog= function( textSeq ){
@ -90,13 +94,15 @@ function DialogUI( stage, gameState ){ @@ -90,13 +94,15 @@ function DialogUI( stage, gameState ){
that.showRandomConvo();
return;
}
delayCounter = 0;
oldTime = new Date().getTime();
that.currDialogueSeq = new DialogueSequence( textSeq.seq );
var nextDialogue = that.currDialogueSeq.next();
that.endFunc = textSeq.endFunc || function(){};
that.textContent.text=nextDialogue[1].replace(/\[GenderPronoun\]/g, gameState.pronoun ).replace(/\[Player\]/g, gameState.name );
that.textContent.text=nextDialogue[1].replace(/\[GenderPronoun\]/g, gameState.pronoun ).replace(/\[Player\]/g, gameState.name || "Sam" );
that.currentFace.y = 250;
that.currentFace = peopleImg[nextDialogue[0]] || that.currentFace;
that.autoAdvance = textSeq.autoAdvance;
@ -121,9 +127,6 @@ function DialogUI( stage, gameState ){ @@ -121,9 +127,6 @@ function DialogUI( stage, gameState ){
gameState.pubsub.subscribe( "ShowDialog", this.showDialog );
// negate double setTimeout if clicked
var oldTime = new Date().getTime();
var delayCounter = 0;
var clickEvent = function( timer ){
if( !peopleImg["Me"] ){
@ -135,7 +138,7 @@ function DialogUI( stage, gameState ){ @@ -135,7 +138,7 @@ function DialogUI( stage, gameState ){
var nextDialogue = that.currDialogueSeq.next();
that.dialogMotionQueue.push(DIALOG_SHOWING);
that.textContent.text=nextDialogue[1];
that.textContent.text=nextDialogue[1].replace(/\[GenderPronoun\]/g, gameState.pronoun ).replace(/\[Player\]/g, gameState.name || "Sam" );
if(DEBUG) console.log("showing face:" +nextDialogue[0] );
// swap out face immediately
@ -165,7 +168,6 @@ function DialogUI( stage, gameState ){ @@ -165,7 +168,6 @@ function DialogUI( stage, gameState ){
return {
tick: function(){
delayCounter = new Date().getTime() - oldTime;
if( that.autoAdvance == true && that.dialogBox.y ==0 && delayCounter > ( (that.textContent.text.length * MILLIS_PER_CHAR) < 2000 ? 2000 : (that.textContent.text.length * MILLIS_PER_CHAR) ) ){
clickEvent();
@ -205,6 +207,7 @@ function DialogUI( stage, gameState ){ @@ -205,6 +207,7 @@ function DialogUI( stage, gameState ){
if( that.dialogMotionQueue.length > 0 && that.dialogState == DIALOG_PAUSING ){
that.dialogState = that.dialogMotionQueue.shift();
}
delayCounter = new Date().getTime() - oldTime;
},
minDialog: function(){

29
js/main.js

@ -71,6 +71,7 @@ function GameState(){ @@ -71,6 +71,7 @@ function GameState(){
// Screens
queue.loadFile( {id: "res/screens/DifficultyScreen/Difficulty-Selection.png", src:"res/screens/DifficultyScreen/Difficulty-Selection.png"} );
queue.loadFile( {id: "res/screens/DifficultyScreen/ButtonsandText.png", src:"res/screens/DifficultyScreen/ButtonsandText.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"} );
@ -87,11 +88,11 @@ function GameState(){ @@ -87,11 +88,11 @@ function GameState(){
queue.loadFile( {id: "HelpP3P4", src:"res/screens/HelpCreditsScreen/HelpP3P4.png" } );
queue.loadFile( {id: "HelpP5P6", src:"res/screens/HelpCreditsScreen/HelpP5P6.png" } );
queue.loadFile( {id: "HelpP7P8", src:"res/screens/HelpCreditsScreen/HelpP7P8.png" } );
queue.loadFile( {id: "HelpP9P10", src:"res/screens/HelpCreditsScreen/HelpP9P10.png" } );
queue.loadFile( {id: "ScoreScreenFile", src:"res/screens/ScoreScreen/Score-Evaluation-1.png" } );
queue.loadFile( {id: "ScoreScreenFile", src:"res/screens/ScoreScreen/Score-Evaluation-2.png" } );
queue.loadFile( {id: "HelpScreenFile", src:"res/screens/HelpCreditsScreen/Credits.png" } );
queue.loadFile( {id: "MarketScreenfile", src:"res/screens/MarketScreen/MarketScreen.png"} );
@ -100,7 +101,6 @@ function GameState(){ @@ -100,7 +101,6 @@ function GameState(){
queue.loadFile( {id: "MarketSoundFile", src:"res/sound/Store/Waterford.mp3"} );
// UI sounds
queue.loadFile( {id: "UILowClickFile", src:"res/sound/GUI/lowclick.mp3"} );
queue.loadFile( {id: "UIClickFile", src:"res/sound/GUI/click.mp3"} );
queue.loadFile( {id: "UIBuzzFile", src:"res/sound/GUI/buzz.mp3"} );
queue.loadFile( {id: "UIDingFile", src:"res/sound/GUI/ding.mp3"} );
@ -108,11 +108,11 @@ function GameState(){ @@ -108,11 +108,11 @@ function GameState(){
// Kitchen Items
queue.loadFile( {id: "res/screens/KitchenScreen/KitchenScreen.png", src:"res/screens/KitchenScreen/KitchenScreen.png"});
queue.loadFile( {id: "res/screens/KitchenScreen/FinalConfirmation.png", src:"res/screens/KitchenScreen/FinalConfirmation.png"});
queue.loadFile( {id: "res/screens/KitchenScreen/TurkeyState1Small.svg", src:"res/screens/KitchenScreen/TurkeyState1Small.svg"});
queue.loadFile( {id: "res/screens/KitchenScreen/TurkeyState2Small.svg", src:"res/screens/KitchenScreen/TurkeyState2Small.svg"});
queue.loadFile( {id: "res/screens/KitchenScreen/TurkeyState3Small.svg", src:"res/screens/KitchenScreen/TurkeyState3Small.svg"});
queue.loadFile( {id: "res/screens/KitchenScreen/TurkeyState4Small.svg", src:"res/screens/KitchenScreen/TurkeyState4Small.svg"});
queue.loadFile( {id: "res/screens/KitchenScreen/TurkeyState5Small.svg", src:"res/screens/KitchenScreen/TurkeyState5Small.svg"});
queue.loadFile( {id: "res/screens/KitchenScreen/TurkeyState1Small.png", src:"res/screens/KitchenScreen/TurkeyState1Small.png"});
queue.loadFile( {id: "res/screens/KitchenScreen/TurkeyState2Small.png", src:"res/screens/KitchenScreen/TurkeyState2Small.png"});
queue.loadFile( {id: "res/screens/KitchenScreen/TurkeyState3Small.png", src:"res/screens/KitchenScreen/TurkeyState3Small.png"});
queue.loadFile( {id: "res/screens/KitchenScreen/TurkeyState4Small.png", src:"res/screens/KitchenScreen/TurkeyState4Small.png"});
queue.loadFile( {id: "res/screens/KitchenScreen/TurkeyState5Small.png", src:"res/screens/KitchenScreen/TurkeyState5Small.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"});
@ -246,7 +246,8 @@ function GameState(){ @@ -246,7 +246,8 @@ function GameState(){
queue.loadFile( {id: "res/screens/Window/Win10.png", src:"res/screens/Window/Win10.png"});
queue.loadFile( {id: "res/screens/Window/Win11.png", src:"res/screens/Window/Win11.png"});
queue.loadFile( {id: "res/screens/Window/Tree_Animation.png", src:"res/screens/Window/Tree_Animation.png"});
queue.loadFile( {id: "res/screens/Window/Test4TransparencyFull.svg", src:"res/screens/Window/Test4TransparencyFull.svg"});
queue.loadFile( {id: "res/screens/Window/Test4TransparencyFull.png", src:"res/screens/Window/Test4TransparencyFull.png"});
queue.loadFile( {id: "res/screens/Window/Stars.png", src:"res/screens/Window/Stars.png"});
@ -283,11 +284,11 @@ function GameState(){ @@ -283,11 +284,11 @@ function GameState(){
/* all turkeys */
this.turkeyStates = [
new createjs.Bitmap( "res/screens/KitchenScreen/TurkeyState1Small.svg" ),
new createjs.Bitmap( "res/screens/KitchenScreen/TurkeyState2Small.svg" ),
new createjs.Bitmap( "res/screens/KitchenScreen/TurkeyState3Small.svg" ),
new createjs.Bitmap( "res/screens/KitchenScreen/TurkeyState4Small.svg" ),
new createjs.Bitmap( "res/screens/KitchenScreen/TurkeyState5Small.svg" )
new createjs.Bitmap( "res/screens/KitchenScreen/TurkeyState1Small.png" ),
new createjs.Bitmap( "res/screens/KitchenScreen/TurkeyState2Small.png" ),
new createjs.Bitmap( "res/screens/KitchenScreen/TurkeyState3Small.png" ),
new createjs.Bitmap( "res/screens/KitchenScreen/TurkeyState4Small.png" ),
new createjs.Bitmap( "res/screens/KitchenScreen/TurkeyState5Small.png" )
];
this.purchasedItems = [];
@ -354,7 +355,7 @@ function GameUI( canvasElem, gameState ){ @@ -354,7 +355,7 @@ function GameUI( canvasElem, gameState ){
var soundManager = new SoundManager( gameState );
this.activeScreenObj = new LoadingScreen( this.stage, gameState );
var textContent = new createjs.Text( "", "20px Arial", "black" );
var textContent = new createjs.Text( "", "20px Arial", "white" );
textContent.x = 750;
textContent.y = 30;
//this.stage.addChild( textContent);

320
js/model.js

@ -1,36 +1,29 @@ @@ -1,36 +1,29 @@
function TurkeyLayer( name, percentRadius, turkeyModel, ovenModel ){
function TurkeyLayer( name, layerNumber1, turkeyModel, ovenModel ){
var that = this;
this.name = name;
this.percentRadius=percentRadius;
this.initialTemp = 20;
this.layerNumber=layerNumber1;
this.waterLost = 0;
this.finalTemperature = 20;
this.cookCondition = "Raw";
this.cookCondition = "Raw";
this.highestTemp = 0;
return {
updateTemperatureTick: function(){
that.finalTemperature = UtilityFunctions.transientSphereSeries( turkeyModel.density,
turkeyModel.thermalConduct,
turkeyModel.heatConvection,
turkeyModel.cp,
percentRadius * turkeyModel.totalRadius,
turkeyModel.totalRadius,
that.initialTemp,
ovenModel.steadyTemp,
ovenModel.globalTime );
that.finalTemperature = turkeyModel.globTemp[that.layerNumber]
if(DEBUG) console.log(turkeyModel.globTemp);
that.highestTemp = that.finalTemperature > that.highestTemp ? that.finalTemperature : that.highestTemp;
that.waterLost = that.waterLost + UtilityFunctions.waterLoss( that.finalTemperature );
that.cookCondition = UtilityFunctions.cookCondition(that.waterLost);
if(DEBUG) console.log( that.name + ": "+ that.waterLost + " " + that.cookCondition);
that.cookCondition = UtilityFunctions.cookCondition(that.waterLost, that.name);
if(DEBUG) console.log( that.name + ": "+ that.waterLost + " " + that.cookCondition + " " + that.finalTemperature + " C" );
},
resetLayerTemps: function(){
that.initialTemp = that.finalTemperature;
},
getCondition: function(){
return that.cookCondition;
},
getTemperature: function(){
return that.finalTemperature;
},
getHighestTemp: function(){
return that.highestTemp;
}
}
@ -38,45 +31,71 @@ function TurkeyLayer( name, percentRadius, turkeyModel, ovenModel ){ @@ -38,45 +31,71 @@ function TurkeyLayer( name, percentRadius, turkeyModel, ovenModel ){
function TurkeyModel( weight, ovenModel ){
this.density = 1050; // kg/m3 Assuming Density of Water 1000 kg/m3
this.cp = 2000; // 2810 J/kg K for Turkey. Extra is to semi-account for water evaporation energy
this.density = 700; // kg/m3 Assuming Density of Water 1000 kg/m3
this.cp = 2810; // 2810 J/kg K for Turkey. Extra is to semi-account for water evaporation energy
this.heatConvection = 9; // W/m2 K Some Reasonable estimate for natural Convection. Change as needed. 5-25
this.thermalConduct = 0.412; // W/m K // Chicken
this.skin = {};
this.body = {};
this.core = {};
this.totalRadius = UtilityFunctions.calculateRadius( weight, this.density );
this.splitsNum = 20;
console.log(UtilityFunctions.lbs2kgs(weight))
this.totalRadius = UtilityFunctions.calculateRadius( UtilityFunctions.lbs2kgs(weight), this.density );
this.totalLayers = [ new TurkeyLayer("Skin", 0.85, this, ovenModel ),
new TurkeyLayer("Body", 0.45, this, ovenModel ),
new TurkeyLayer("Core", 0.01, this, ovenModel ) ];
this.totalLayers = [ new TurkeyLayer("Skin", this.splitsNum-1, this, ovenModel ),
new TurkeyLayer("Body", this.splitsNum-10, this, ovenModel ),
new TurkeyLayer("Core", 1, this, ovenModel ) ];
// Whenever temperature is changed
this.updateLayerTemps = function(){
this.updateLayerTemps = function() {
this.globTemp = UtilityFunctions.transientSphereSeries( this.density,
this.thermalConduct,
this.heatConvection,
this.cp,
this.totalRadius,
ovenModel.tempInfini,
this.splitsNum,
this.deltar,
this.globTemp,
this.pointRadius
);
for (var i in this.totalLayers ){
this.totalLayers[i].updateTemperatureTick();
}
};
this.resetLayerTemps = function(){
for (var i in this.totalLayers ){
this.resetLayerTemps = function() {
for (var i in this.totalLayers ) {
this.totalLayers[i].resetLayerTemps();
}
};
//Sheen Model Stuff
this.globTemp=[];
this.pointRadius = []
this.splitsNum = 20;
this.deltar = this.totalRadius/this.splitsNum; //20 Data Points
this.initializePoints = function() {
var step = ( this.totalRadius - this.deltar ) / ( this.splitsNum - 1 );
for (var i = 0; i<this.splitsNum ; i++ ) {
this.pointRadius.push(step*i+this.deltar);
this.globTemp.push(20+step*i); //Starts at 20 C for initilizating
}
};
this.initializePoints()
}
function OvenModel( turkeyWeight, gameState ) {
var that = this;
this.tempInfini=20; //C
this.setTemp = 20;
this.steadyTemp = 20;
this.steadyTimer = 0;
this.globalTime = 0;
var turkey = new TurkeyModel(9.07185, this );
var turkey = new TurkeyModel(turkeyWeight, this );
var proportional = 0.004; // This value is arbitrary to how fast you want the temperatures to converge. (Or oscillate, which could be realistic as well)
var errorTolerance = 10; //Stove is accurate to 1 degree Celcius Should hopefully oscillate below that value.
// Equalize temp will need to be sent each time iteration
@ -90,13 +109,6 @@ function OvenModel( turkeyWeight, gameState ) { @@ -90,13 +109,6 @@ function OvenModel( turkeyWeight, gameState ) {
}
if( error>errorTolerance ) {
if (this.steadyTimer>=80) {
//Reset the model's time calculation if there are major changes in the tolerance of the temperature or the steady timer expires
this.steadyTimer = 0;
this.globalTime = 0;
this.steadyTemp = this.tempInfini
turkey.resetLayerTemps();
}
return(true);
}
}
@ -105,15 +117,18 @@ function OvenModel( turkeyWeight, gameState ) { @@ -105,15 +117,18 @@ function OvenModel( turkeyWeight, gameState ) {
return {
"skin" : {
"temp": turkey.totalLayers[0].getTemperature(),
"cond": turkey.totalLayers[0].getCondition()
"cond": turkey.totalLayers[0].getCondition(),
"highest" : turkey.totalLayers[0].getHighestTemp()
},
"body" : {
"temp": turkey.totalLayers[1].getTemperature(),
"cond": turkey.totalLayers[1].getCondition()
"cond": turkey.totalLayers[1].getCondition(),
"highest" : turkey.totalLayers[1].getHighestTemp()
},
"core" : {
"temp": turkey.totalLayers[2].getTemperature(),
"cond": turkey.totalLayers[2].getCondition()
"cond": turkey.totalLayers[2].getCondition(),
"highest" : turkey.totalLayers[2].getHighestTemp()
}
};
},
@ -134,19 +149,15 @@ function OvenModel( turkeyWeight, gameState ) { @@ -134,19 +149,15 @@ function OvenModel( turkeyWeight, gameState ) {
},
secondTick: function(){
that.globalTime = that.globalTime + 1;
that.steadyTimer = that.steadyTimer + 1;
if ( that.equalizeTemp() ) {
// Turn on oven light
gameState.pubsub.publish( "OvenLight", "On" );
}
else {
that.steadyTemp = that.tempInfini;
// Turn off oven light
gameState.pubsub.publish( "OvenLight", "Off" );
}
if(DEBUG) console.log("Steady Temp " + that.steadyTemp)
if(DEBUG) console.log("Steady Timer " + that.steadyTimer)
if(DEBUG) console.log("Oven Temp " + that.tempInfini )
turkey.updateLayerTemps();
}
@ -179,26 +190,6 @@ UtilityFunctions = { @@ -179,26 +190,6 @@ UtilityFunctions = {
return complexRadius;
},
findAllRoots: function(min,max,splitsNum,Biot) {
var step = ( max - min ) / ( splitsNum - 1 );
var answer;
var negativeTest;
var storage = [];
for (var i = step; i < max; i=i+step ) {
negativeTest = this.lambdaFormula(i-step, Biot)*this.lambdaFormula(i, Biot);
if (negativeTest <= 0) {
answer = this.bisectionMethod(i-step,i,Biot);
if (answer !=undefined) {
storage.push(answer);
}
}
else {
//if(DEBUG) console.log("No Bracketed Root " + negativeTest)
}
}
return storage;
},
sphereVolume: function(radius) {
return((4/3)*Math.PI*Math.pow(radius,3))
},
@ -207,74 +198,50 @@ UtilityFunctions = { @@ -207,74 +198,50 @@ UtilityFunctions = {
return (Math.pow(10,(temperature-20)/80)-1)
},
transientSphereSeries: function( density, thermalConduct, heatConvection, cp, rTotal, tempInfinity, splitsNum, deltar, globTemp,pointRadius) {
//Not Global Stuff
var r0 = rTotal;
var deltat = 0.1
var alpha = thermalConduct/(density*cp)
var h=heatConvection;
for (var j=0; j<(1/deltat); j++ ) {
var dTdr=[]
// globTemp[splitsNum-1] should be last entry in globtemp
for (var k=0; k<splitsNum; k++){
if (k==0) {
dTdr.push((globTemp[1] - globTemp[0])/deltar) }
else if (k==splitsNum-1) {
dTdr.push((globTemp[splitsNum-1] - globTemp[splitsNum-2])/deltar)}
else {
dTdr.push((globTemp[k+1] - globTemp[k-1])/(2*deltar))}
}
dTdr[splitsNum-1] = heatConvection*(tempInfinity-globTemp[splitsNum-1])/thermalConduct
var parenthesis = []
for (var k=0; k<splitsNum; k++){
parenthesis.push(dTdr[k]*Math.pow(pointRadius[k],2))
}
dPdr = []
for (var k=0; k<splitsNum; k++){
if (k==0) {
dPdr.push((parenthesis[1] - parenthesis[0])/deltar) }
else if (k==splitsNum-1) {
dPdr.push((parenthesis[splitsNum-1] - parenthesis[splitsNum-2])/deltar)}
else {
dPdr.push((parenthesis[k+1] - parenthesis[k-1])/(2*deltar))}
}
for (var k=0; k<splitsNum; k++){
globTemp[k]=alpha*dPdr[k]/Math.pow(pointRadius[k],2)*deltat + globTemp[k] //dTdr * deltaT in one loop
}
//dTdt(1)=dTdt(1)/2;
}
bisectionMethod: function(min,max,Biot) {
errorTolerance = (1/Math.pow(10,8))
result = Infinity // some large value to ensure the calculation goes through.
negativeTest =this.lambdaFormula(min, Biot)*this.lambdaFormula(max, Biot)
if (negativeTest <=0 ) {
var antiFreeze=0;
while (Math.abs(result) > errorTolerance && antiFreeze<=500) { //The greater the antiFreeze, the more wasted cycles around a singularity
lambdaN = (min+max)/2
result=this.lambdaFormula(lambdaN, Biot)
if (Math.abs(result) <= errorTolerance && result<=errorTolerance) {
return (lambdaN); //At Root
}
else if ((this.lambdaFormula(min, Biot)*this.lambdaFormula(lambdaN, Biot))>=0) {
min=lambdaN;
}
else if ((this.lambdaFormula(max, Biot)*this.lambdaFormula(lambdaN, Biot))>=0) {
max=lambdaN;
}
antiFreeze++
}
}
},
lambdaFormula: function( lambdaN, Biot ) {
var result = 1-lambdaN*(1/Math.tan(lambdaN))-Biot;
return(result)
},
transientSphereSeries: function( density, thermalConduct, heatConvection, cp, rPosition, rTotal, tempInitial, tempInfini, t ){
var min = 0;
var max = 10000; // This are for setting Lambda boundaries and nothing else
var sum=0;
var alpha = thermalConduct/(density*cp);
var lambdaN;
var sinPortion;
var exponentialPortion;
var frontCoefficientPortion;
//if(DEBUG) console.log("Alpha is " + alpha)
var Fourier = (alpha*t)/Math.pow(rTotal,2)
//if(DEBUG) console.log("Fourier is " + Fourier)
var biotNum = heatConvection * rTotal/thermalConduct
if ( biotNum != this.cachedBiot ) {
if(DEBUG) console.log("Recalculating Lambda Terms")
this.cachedLambda = this.findAllRoots(min,max,max*Math.PI*10,biotNum)
this.cachedBiot = biotNum;
}
//if(DEBUG) console.log("The Biot Value is " + biotNum)
for (var i = 0; i<this.cachedLambda.length; i++) {
var lambdaN = this.cachedLambda[i];
var sinPortion= Math.sin(lambdaN*rPosition/rTotal)/(lambdaN*rPosition/rTotal);
var exponentialPortion = (1/Math.exp(Math.pow(lambdaN,2)*Fourier));
var frontCoefficientPortion = 4*(Math.sin(lambdaN)-(lambdaN*Math.cos(lambdaN)))/ (2*lambdaN-Math.sin(2*lambdaN));
sum = frontCoefficientPortion*exponentialPortion*sinPortion + sum;
}
tempAtTimeAndRadius=(sum*(tempInitial-tempInfini))+tempInfini
if(DEBUG) console.log("The Temperature at radius " + rPosition + " m and time " + t/60/60 + " hours is " + tempAtTimeAndRadius + " C or " + this.C2F(tempAtTimeAndRadius) + " F");
return(tempAtTimeAndRadius)
return(globTemp)
},
/* Utility Functions */
@ -290,31 +257,62 @@ UtilityFunctions = { @@ -290,31 +257,62 @@ UtilityFunctions = {
randRange: function(min, max){
return Math.floor(Math.random()*(max-min+1))+min;
},
cookCondition: function(cookValue,volume){
var multiplier = 1;
if (cookValue>=multiplier*600000) {
return ["Fire", (cookValue-600000)/(multiplier*600000),"fire"];
}
else if(cookValue>=multiplier*250000) {
return ["Burnt", (cookValue-250000)/(multiplier*600000), "burnt"];
}
else if (cookValue>=multiplier*150000) {
return ["Dry", (cookValue-150000)/(multiplier*250000), "dry"];
}
else if (cookValue>=multiplier*85000){
return ["Cooked", (cookValue-12000)/(multiplier*150000), "overcooked"];
}
else if (cookValue>=multiplier*12000) {
return ["Cooked", (cookValue-12000)/(multiplier*150000), "cooked"];
}
else if (cookValue>=multiplier*10000){
return ["Undercooked", (cookValue-5000)/(multiplier*12000), "slightly cooked"];
}
else if (cookValue>=multiplier*5000) {
return ["Undercooked", (cookValue-5000)/(multiplier*12000), "undercooked"];
cookCondition: function(cookValue, layerName){
if( layerName == "Skin" || layerName == "Body" ){
var multiplier = 1;
if (cookValue>=multiplier*600000) {
return ["Fire", (cookValue)/(multiplier*700000),"fire"];
}
else if(cookValue>=multiplier*400000) {
return ["Burnt", (cookValue)/(multiplier*600000), "burnt"];
}
else if (cookValue>=multiplier*300000) {
return ["Dry", (cookValue)/(multiplier*350000), "dry"];
}
else if (cookValue>=multiplier*250000){ // >250000
return ["Cooked", (cookValue)/(multiplier*300000), "overcooked"];
}
else if (cookValue>=multiplier*80000) { // >50000
return ["Cooked", (cookValue)/(multiplier*250000), "cooked"];
}
else if (cookValue>=multiplier*50000){
return ["Undercooked", (cookValue)/(multiplier*80000), "slightly cooked"];
}
else if (cookValue>=multiplier*25000) { //
return ["Undercooked", (cookValue)/(multiplier*50000), "undercooked"];
}
else {
return ["Raw", 1, "raw"];
}
}
else {
return ["Raw", 1, "raw"];
else{
var multiplier = 1;
if (cookValue>=multiplier*45000) { //
return ["Fire", (cookValue)/(multiplier*600000),"fire"];
}
else if(cookValue>=multiplier*35000){//
return ["Burnt", (cookValue)/(multiplier*45000), "burnt"];
}
else if (cookValue>=multiplier*25000){ //
return ["Dry", (cookValue)/(multiplier*35000), "dry"];
}
else if (cookValue>=multiplier*22000){ //
return ["Cooked", (cookValue)/(multiplier*25000), "overcooked"];
}
else if (cookValue>=multiplier*12000){ //
return ["Cooked", (cookValue)/(multiplier*22000), "cooked"];
}
else if (cookValue>=multiplier*7000){ //
return ["Undercooked", (cookValue)/(multiplier*12000), "slightly cooked"];
}
else if (cookValue>=multiplier*3000) {
return ["Undercooked", (cookValue)/(multiplier*7000), "undercooked"];
}
else {
return ["Raw", 1, "raw"];
}
}
}
}
@ -322,8 +320,8 @@ UtilityFunctions = { @@ -322,8 +320,8 @@ UtilityFunctions = {
//Running the Program Stuff
/*
var ovenObject = new OvenModel();
var turkey = new TurkeyModel(9.07185, ovenObject );
var turkey = new TurkeyModel(9, ovenObject);
globalTime=0;
setInterval(function(){ovenObject.secondTick();},10);
setInterval(function(){ovenObject.secondTick();},1000);
*/

48
js/screens.js

@ -15,7 +15,6 @@ function LoadingScreen( stage, gameState ){ @@ -15,7 +15,6 @@ function LoadingScreen( stage, gameState ){
this.done.alpha= 0;
stage.addChild( this.picture );
stage.addChild( this.cooking );
stage.addChild( this.done );
stage.addChild( this.turkeyState[0] );
var textContent = new createjs.Text( "0 %", "25px Arial", "black" );
@ -25,7 +24,7 @@ function LoadingScreen( stage, gameState ){ @@ -25,7 +24,7 @@ function LoadingScreen( stage, gameState ){
gameState.pubsub.subscribe( "Load", function(percent){
textContent.text = (percent * 25).toFixed(2) + " %";
var wholeNum = percent.toFixed(0);
var wholeNum = Math.floor(percent);
if( that.lastPercent != percent){
that.lastPercent = percent;
stage.addChild( that.turkeyState[wholeNum] );
@ -52,6 +51,7 @@ function LoadingScreen( stage, gameState ){ @@ -52,6 +51,7 @@ function LoadingScreen( stage, gameState ){
}
});
stage.addChild( this.done );
stage.addChild( this.pictureFront );
return {
@ -178,8 +178,10 @@ function DifficultyScreen( stage, gameState ){ @@ -178,8 +178,10 @@ function DifficultyScreen( stage, gameState ){
}
}
if( keynum != 8 && keynum < 91 && keynum > 47 && nameInput.text.length < 22 )
if( keynum != 8 && keynum < 91 && keynum > 47 && nameInput.text.length < 22 ){
nameInput.text += String.fromCharCode(keynum);
gameState.name = nameInput.text;
}
};
@ -195,19 +197,19 @@ function DifficultyScreen( stage, gameState ){ @@ -195,19 +197,19 @@ function DifficultyScreen( stage, gameState ){
}
}
if(keynum == 8 && nameInput.text.length > 0 )
if(keynum == 8 && nameInput.text.length > 0 ){
nameInput.text = nameInput.text.substr(0, nameInput.text.length-1);
gameState.name = nameInput.text;
}
event.preventDefault();
}
gameState.name = nameInput.text;
// 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, null, null, function(){ gameState.hard = false; gameState.gameStarted = true; gameState.hardcoreModifier=20; gameState.pubsub.publish("SwitchScreen", "KitchenScreen"); } ) );
stage.addChild( new Button( stage, gameState, 500, 495, 205, 55, null, null, function(){ gameState.hard = true; gameState.gameStarted = true; gameState.hardcoreModifier=1; gameState.pubsub.publish("SwitchScreen", "KitchenScreen"); } ) );
stage.addChild( new Button( stage, gameState, 503, 370, 200, 55, null, null, function(){ document.onkeyup = function(){}; gameState.hard = false; gameState.gameStarted = true; gameState.hardcoreModifier=1; gameState.pubsub.publish("SwitchScreen", "KitchenScreen"); } ) );
stage.addChild( new Button( stage, gameState, 500, 495, 205, 55, null, null, function(){ document.onkeydown = function(){}; gameState.hard = true; gameState.gameStarted = true; gameState.hardcoreModifier=20; gameState.pubsub.publish("SwitchScreen", "KitchenScreen"); } ) );
stage.addChild( new Button( stage, gameState, 35, 495, 85, 55, "SwitchScreen", "MainScreen" ) );
@ -403,7 +405,7 @@ function ScoreScreen( stage, gameState ){ @@ -403,7 +405,7 @@ function ScoreScreen( stage, gameState ){
var totalScore = 0;
var skinScoreChart = {
"raw": 0,
"raw": -1000,
"undercooked": -100,
"slightly cooked": 75,
"cooked": 500,
@ -415,9 +417,9 @@ function ScoreScreen( stage, gameState ){ @@ -415,9 +417,9 @@ function ScoreScreen( stage, gameState ){
var coreScoreChart = {
"raw": 0,
"undercooked": 125,
"slightly cooked": 750,
"slightly cooked": 600,
"cooked": 1000,
"overcooked": 1000,
"overcooked": 750,
"dry": 400,
"burnt": 0
};
@ -439,29 +441,28 @@ function ScoreScreen( stage, gameState ){ @@ -439,29 +441,28 @@ function ScoreScreen( stage, gameState ){
};
// Temperature Score
var outerTemp = UtilityFunctions.C2F(turkeyState.skin.temp).toFixed(2);
var outerTemp = UtilityFunctions.C2F(turkeyState.skin.highest).toFixed(2);
var coreTemp = UtilityFunctions.C2F(turkeyState.core.temp).toFixed(2);
var outerTempScore = that.scoreDistribution( outerTemp ) * 200;
var outerTempScore = that.scoreDistribution( outerTemp, "skin" ) * 200;
var coreTempScore = that.scoreDistribution( coreTemp ) * 200;
totalScore += parseInt(skinScoreChart[ turkeyState.skin.cond[2]]);
totalScore += parseInt(skinScoreChart[ turkeyState.core.cond[2]]);
totalScore += parseInt(coreScoreChart[ turkeyState.core.cond[2]]);
totalScore += parseInt(outerTempScore.toFixed(0));
totalScore += parseInt(coreTempScore.toFixed(0));
resultsDialogue = [];
if (totalScore>=2000) {
if (totalScore>=1800) {
randomDiag = perfect;
}
else if (totalScore>=1200) {
else if (totalScore>=1400) {
randomDiag = great;
}
else if (totalScore>=625) {
else if (totalScore>=1000) {
randomDiag = average;
}
else if (totalScore>=300) {
else if (totalScore>=400) {
randomDiag = subPar;
}
else {
@ -551,7 +552,7 @@ function ScoreScreen( stage, gameState ){ @@ -551,7 +552,7 @@ function ScoreScreen( stage, gameState ){
outerConditionText.x = 310;
outerConditionText.y = 320;
var coreConditionText = new createjs.Text( coreScoreChart[ turkeyState.skin.cond[2] ], "20px Arial", "black" );
var coreConditionText = new createjs.Text( coreScoreChart[ turkeyState.core.cond[2] ], "20px Arial", "black" );
coreConditionText.x = 310;
coreConditionText.y = 340;
@ -592,14 +593,13 @@ function ScoreScreen( stage, gameState ){ @@ -592,14 +593,13 @@ function ScoreScreen( stage, gameState ){
// Modifiers
var turkeyMod = typeToMod[gameState.turkeyType];
var turkeyTypeModifierText = new createjs.Text( "+"+(Math.abs(turkeyMod-1)*100).toFixed(0) + "%", "20px Arial", "black" );
var turkeyTypeModifierText = new createjs.Text( -1*((1-turkeyMod)*100).toFixed(0) + "%", "20px Arial", "black" );
turkeyTypeModifierText.x = 310;
turkeyTypeModifierText.y = 437;
totalScore *= turkeyMod;
var stuffingTypeModifierText = new createjs.Text( "+"+(Math.abs(gameState.stuffingTypeModifier-1)*100).toFixed(0)+"%" , "20px Arial", "black" );
var stuffingTypeModifierText = new createjs.Text( -1*((1-gameState.stuffingTypeModifier)*100).toFixed(0)+"%" , "20px Arial", "black" );
stuffingTypeModifierText.x = 310
stuffingTypeModifierText.y = 457;
@ -626,8 +626,6 @@ function ScoreScreen( stage, gameState ){ @@ -626,8 +626,6 @@ function ScoreScreen( stage, gameState ){
stage.addChild( turkeyTypeModifierText );
stage.addChild( frillsModifierText );
stage.addChild( hardcoreModifierText );
}} );

1
js/soundmanager.js

@ -14,7 +14,6 @@ function SoundManager( gameState ){ @@ -14,7 +14,6 @@ function SoundManager( gameState ){
// Register all sounds loaded in gameState
createjs.Sound.registerSound("res/sound/turkey_in_the_straw.mp3", "TitleMusic");
createjs.Sound.registerSound("res/sound/Store/Waterford.mp3", "MarketMusic");
createjs.Sound.registerSound("res/sound/GUI/lowclick.mp3", "LowClick");
createjs.Sound.registerSound("res/sound/GUI/click.mp3", "Click");
createjs.Sound.registerSound("res/sound/GUI/buzz.mp3", "Error");
createjs.Sound.registerSound("res/sound/Store/buy.mp3", "Buy");

212
js/stories.js

@ -4,8 +4,8 @@ var messages = { @@ -4,8 +4,8 @@ var messages = {
"CannotBuyTurkey" : ["Me: I barely have time for ONE turkey, let alone TWO!"],
"NoMoney" : ["Me: I can't afford this!"],
"BuyTurkeyFirst" : ["Me: I should buy a turkey first!"],
"EmptyOven" : ["Me: Ah, the oven is already preheated..."],
"OpenDoor" :["Me: I should probably try opening the oven door to measure the turkey's temperature"]
"EmptyOven" : ["Me: I'll start cooking once I get a turkey."],
"OpenDoor" :["Me: I should probably try opening the oven door to measure the turkey's temperature."]
}
//Terrible Results
@ -17,8 +17,8 @@ var terrible = [ @@ -17,8 +17,8 @@ var terrible = [
"Mom: No thanks, I'm actually a vegetarian.",
"Brother: Who taught you how to cook?",
"Brother: What an awful turkey.",
"Girlfriend: I'm leaving you honey. It's not you, its the turkey.",
"Cat: Meow Meow ('Get out of my house!')"];
"Spouse: I'm leaving you honey. It's not you, its the turkey.",
"Cat: Meow Meow (Get out of my house!)"];
//Subpar Results
var subPar = [
@ -32,9 +32,9 @@ var subPar = [ @@ -32,9 +32,9 @@ var subPar = [
"Mom: You are welcome here no matter how well you cook.",
"Mom: Honey, I think this turkey could have turned out better.",
"Brother: Uhh, What's for dessert?",
"Brother: We should get a pre-baked turkey next time",
"Girlfriend: Hey, the cat seems to like it.",
"Girlfriend: We'll have to go to some cooking classes together.",
"Brother: We should get a pre-baked turkey next time.",
"Spouse: Hey, the cat seems to like it.",
"Spouse: We'll have to go to some cooking classes together.",
"Cat: Hisssssss"];
//Average Results
@ -44,8 +44,8 @@ var average = [ @@ -44,8 +44,8 @@ var average = [
"Dad: Pretty decent turkey have you cooked here.",
"Mom: Tastes better than store cooked turkeys.",
"Brother: This is way better than I expected.",
"Girlfriend: Not bad.",
"Cat: Meow meow ('I may not leave a present in your shoes today')"];
"Spouse: Not bad.",
"Cat: Meow meow (I may not leave a present in your shoes today)"];
//Great Results
var great = [
@ -57,8 +57,8 @@ var great = [ @@ -57,8 +57,8 @@ var great = [
"Mom: The second best turkey I have ever had!",
"Mom: You should teach me your secrets",
"Brother: Way to go, this turkey is fantastic.",
"Girlfriend: Oh, what a nice turkey.",
"Cat: Meow MEOW! ('I am pleased, human')"];
"Spouse: Oh, what a nice turkey.",
"Cat: Meow MEOW! (I am pleased, human)"];
//Perfect Results
var perfect = [
@ -68,8 +68,8 @@ var perfect = [ @@ -68,8 +68,8 @@ var perfect = [
"Mom: This turkey is delicious. Let's get you two wed immediately!",
"Mom: Never have I had a more scrumptious turkey!",
"Brother: All-praise the turkeymeister!",
"Girlfriend: Bite after bite of gourmet delight!",
"Girlfriend: We should get married. Tonight!",
"Spouse: Bite after bite of gourmet delight!",
"Spouse: We should get married. Tonight!",
"Cat: Puuuurrrrrrr"];
@ -219,7 +219,7 @@ var story = { @@ -219,7 +219,7 @@ var story = {
"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",
"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.",
@ -250,65 +250,65 @@ var story = { @@ -250,65 +250,65 @@ var story = {
"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?",
["Spouse: You know what boba is right Mom?",
"Mom: What's Boba?",
"Girlfriend: Ok, I guess not.",
"Spouse: Ok, I guess not.",
"Grandma: What's booba?",
"Girlfriend: I take it you mean boba?",
"Spouse: 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.",
"Spouse: What most people talk about when they mean 'boba' are tea drinks with milk in them.",
"Spouse: 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.",
"Spouse: [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.",
"Spouse: 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.",
"Spouse: Not really, it is chewy, a bit like... when you take the first bite into some gum. Right before it gets soft.",
"Spouse: 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!",
"Spouse: You definitely should since I know you like your morning tea.",
"Spouse: Now that you all know what boba is, I can tell you about this cool, and somewhat awkward event that happened.",
"Spouse: [Player] and I were driving down the freeway when we remembered that a new boba place was opening up on Teller St.",
"Spouse: As part of their opening promotion, they were offering one free boba drink per customer.",
"Spouse: Since I was thirsty, I suggested we drop by and see what's up.",
"Spouse: We parked and walk up to the building. There weren't too many people about, and a sign revealed why.",
"Spouse: 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!",
"Spouse: I decided to get a drink anyways.",
"Spouse: But when I ordered, the worker said 'Would you like to try one of our free drinks?', and motioned towards the sign.",
"Spouse: 'Sure!', Then he asked [Player] what [GenderPronoun] wanted.",
"Spouse: 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",
"Spouse: Yes, there are. I ordered Strawberry. It tasted ok, but was really missing that strawberry flavor.",
"Spouse: The worker asked how they were, and well Mom, you raised me to be an honest individual, so it was lacking in flavor.",
"Spouse: So the worker says, 'Alright, let me make you another one'",
"Spouse: 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!",
"Spouse: 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.",
"Spouse: He then proceeded to make another drink, still free, using fresh strawberries in lieu of the syrup flavoring.",
"Spouse: Now the syrup drinks were probably really cheap to make, but making drinks with real fruit costs considerably more.",
"Spouse: By the end of our time at the place, the two of us had six drinks in hand without a cent spent.",
"Spouse: The worker just kept offering us samples and I felt really guilty about being so honest.",
"Spouse: 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.",
"Spouse: Yes, I tipped, [Player] made sure of that.",
"Spouse: With all the caffeine and sugar, I couldn't sleep all night. My heart was in trepidation even through the next morning.",
"Spouse: 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.",
"Spouse: 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.",
"Spouse: Hah, no.",
"Brother: No, seriously.",
"Girlfriend: And seriously. No"],
"Spouse: 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] like that. [Player] is a great cook. You'll see!",
"Spouse: How dare you talk about [Player] like that. [Player] is a great cook. 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.",
@ -327,7 +327,7 @@ var story = { @@ -327,7 +327,7 @@ var story = {
"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?",
"Spouse: 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.",
@ -346,14 +346,14 @@ var story = { @@ -346,14 +346,14 @@ var story = {
"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!)"],
"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?",
"Spouse: 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?",
"Spouse: 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.",
@ -367,7 +367,7 @@ var story = { @@ -367,7 +367,7 @@ var story = {
"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?",
"Spouse: Close game?",
"Brother: Hardly. 3-0",
"Brother: The tornado mascot kept it interesting though, with his kazoo.",
"Brother: 'Bzzzwoooooo'",
@ -389,16 +389,16 @@ var story = { @@ -389,16 +389,16 @@ var story = {
"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?",
["Spouse: 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.",
"Spouse: 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.",
"Spouse: 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.",
"Spouse: 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.",
@ -427,10 +427,10 @@ var story = { @@ -427,10 +427,10 @@ var story = {
"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.",
"Spouse: Hah ha brother. Sucks to be you. Hah ha!",
"Spouse: 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!"],
"Spouse: 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?",
@ -439,42 +439,42 @@ var story = { @@ -439,42 +439,42 @@ var story = {
"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: 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: 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 vodka. ",
"Grandpa: Advice to keep close at heart. "],
"Grandpa: Advice to keep close at heart."],
"Dad Tells a Bad Dad 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?",
"Spouse: It is the turkey right?",
"Dad: That's right, its the turKEY",
"Dad: turKEY, get it?",
"Girlfriend: What?",
"Spouse: What?",
"Dad: The KEY to a great thanksgiving dinner is the turKEY.",
"Girlfriend: Aww, come on Dad. That's terrible.",
"Spouse: 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: Well, what do you mean 'key'.",
"Dad: 'Key', as in, characteristic, identifying.",
"Grandma: hmmm, ok. I think I get it.",
"Dad: Ok...."],
"Mom Butter Story":
["Mom: My favorite color is butter.",
"Girlfriend: That's cool."],
"Spouse: That's cool."],
"Cat Story":
["Cat: Meow Meow Meow Meow Meow",
@ -482,19 +482,19 @@ var story = { @@ -482,19 +482,19 @@ var story = {
"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: (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.",
"Cat: (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.",
"Cat: (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!"],
"Cat: (I don't want turkey, I want fish!)"],
"Mom Talks About Her Bathroom Policy and her Students":
@ -509,7 +509,7 @@ var story = { @@ -509,7 +509,7 @@ var story = {
"Mom: But then the administration told me that all students were required to have a bathroom pass. Too many students were skipping class they feared.",
"Mom: I never lost a student and all my students knew not to abuse their privileges, but I did as I was told.",
"Mom: I made sure students signed themselves out, wrote their name, signed it, then took the bathroom pass.",
"Girlfriend: That seems very efficient. But are the third graders mature enough to get themselves to the bathroom and not goof off?",
"Spouse: That seems very efficient. But are the third graders mature enough to get themselves to the bathroom and not goof off?",
"Mom: Well, every student has their 20 minutes. I don't want to parent them. That's not my job. My job is to teach lessons.",
"Mom: It seemed to work well. None of my students abused the system.",
"Mom: But it seemed the administration didn't appreciate the system. They changed the rules once again.",
@ -553,35 +553,35 @@ var story = { @@ -553,35 +553,35 @@ var story = {
"Grandpa: Field medics couldn't get all the pieces out, and we were at least two days away from a decent hospital.",
"Grandpa: The ear got infected and Jimmy lost his hearing soon after.",
"Grandpa: 'Bug Brain' we used to call him. Great guy.",
"Girlfriend: I'm sorry to hear that.",
"Spouse: I'm sorry to hear that.",
"Grandpa: Can't undo the past. Those dang bugs were everywhere though.",
"Mom: Gross, Gross, Gross. ",
"Grandpa: It isn't that bad. Be grateful I didn't tell you the story where we ate them. Not bad. A little crunchy. Not as good as turkey though.",
"Mom: !!!"],
"Story about Girlfriend's teacher that makes buzzer noises when you got something wrong":
["Girlfriend: Greg, here's something that might tinkle your fancy.",
"Girlfriend: I saw my old professor from a couple years back, Professor Ronfleur. The Humanities teacher. Do you remember him?",
"Story about Spouse's teacher that makes buzzer noises when you got something wrong":
["Spouse: Greg, here's something that might tinkle your fancy.",
"Spouse: I saw my old professor from a couple years back, Professor Ronfleur. The Humanities teacher. Do you remember him?",
"Brother: The guy who always wore the purple bow tie? Who could forget him? Did he buzz you?",
"Girlfriend: Ha-ha, no, but that's why I brought it up. That buzz!",
"Spouse: Ha-ha, no, but that's why I brought it up. That buzz!",
"Mom: What buzz?",
"Girlfriend: I guess we never told you Mom. Remember when we took that humanities class at the local community college during the summer?",
"Girlfriend: We were trying to get the lower division English requirements out the way so could take classes at college that were actually worth our time.",
"Girlfriend: This Professor Ronfleur used to make a buzzing sound whenever anybody got something wrong.",
"Girlfriend: 'In what way does Aristotle disagree with Plato's Allegory of the Cave?' and then...",
"Girlfriend: BRRZZZZZZZT!",
"Girlfriend: He would make this super nasally buzzing noise.",
"Spouse: I guess we never told you Mom. Remember when we took that humanities class at the local community college during the summer?",
"Spouse: We were trying to get the lower division English requirements out the way so could take classes at college that were actually worth our time.",
"Spouse: This Professor Ronfleur used to make a buzzing sound whenever anybody got something wrong.",
"Spouse: 'In what way does Aristotle disagree with Plato's Allegory of the Cave?' and then...",
"Spouse: BRRZZZZZZZT!",
"Spouse: He would make this super nasally buzzing noise.",
"Brother: Seriously! Whenever I see the guy, I can just imagine pressing his bow tie and a buzzing noise coming out.",
"Girlfriend: And he did it ALL. THE. TIME.",
"Spouse: And he did it ALL. THE. TIME.",
"Brother: Yeah! Did he say anything to you when he saw you?",
"Girlfriend: I said hello and introduced myself, but he didn't know me. Just gave me the glazed ham eye look.",
"Spouse: I said hello and introduced myself, but he didn't know me. Just gave me the glazed ham eye look.",
"Brother: Glazed ham?",
"Girlfriend: For Thanksgiving.",
"Spouse: For Thanksgiving.",
"Brother: He gave you the glazed turkey look.",
"Girlfriend: Exactly."],
"Spouse: Exactly."],
"Brother's Fiancee is on Business Trip":
["Mom: Greg, where's your fiancée? Why didn't you invite her over for Thanksgiving dinner?",
["Mom: Greg, where's your fiancee? Why didn't you invite her over for Thanksgiving dinner?",
"Brother: I did invite her, but she couldn't make it. She is on a business trip and could not get the time off.",
"Mom: A business trip on Thanksgiving? But Thanksgiving only happens once per year! This is the perfect time to rekindle the spirit of family.",
"Brother: I know Mom, but Thanksgiving doesn't happen everywhere, and her job in sales demands that she travel abroad to meet with potential clients in person.",
@ -592,8 +592,8 @@ var story = { @@ -592,8 +592,8 @@ var story = {
"Brother: uh, well yeah, sure Mom. You can come and visit.",
"Grandpa: What!? I want to come and see your new place too.",
"Brother: Sure...yeah ok.",
"Girlfriend: You aren't going to invite me?",
"Brother: Yes, definitely. Everyone can come and visit. Just... I don't want to stress out my fiancée when she comes home.",
"Spouse: You aren't going to invite me?",
"Brother: Yes, definitely. Everyone can come and visit. Just... I don't want to stress out my fiancee when she comes home.",
"Brother: She likes to relax at home.",
"Mom: Don't worry honey, we won't stress her out. I'll make her my delicious breakfast omelet.",
"Grandpa: And I'll tell her my war stories.",
@ -604,15 +604,15 @@ var story = { @@ -604,15 +604,15 @@ var story = {
"Turkey: Male turkeys like their snood intact to attract a mate, and for dominance. Be kind to your turkey. Do not lose the snood."],
"Turkey Fact - Cat Puns":
["Turkey: Gobble Gobble. I suppose it is too late to ask you not to eat me. But is it too late to ask for you to kick that cat of yours?",
["Turkey: Gobble Gobble. I suppose it is too late to ask you not to eat me. But is it too late to ask for you to kick that cat?",
"Cat: Hey Turkey, it has been a long time. I see you're dead.",
"Turkey: Kasey, how dare you speak to me. First, you steal my plans for world domination and now you gloat at my passing. For shame.",
"Cat: It isn't my fault you taste so delicious. I'm going to delight in eating your flesh. Maybe if I beg enough they may give me your head on a platter",
"Cat: It isn't my fault you taste so delicious. I'm going to delight in eating your flesh. Maybe if I beg enough they may give me your head on a platter.",
"Turkey: Oooh, don't get me fired up.",
"Cat: Meow meow meow! The oven is doing that quite nicely.",
"Turkey: Ga-Gobble!",
"Cat: Meow Meow",
"Dad: Aww Kasey, can't you a cute little kitty."],
"Dad: Aww Kasey, aren't you a cute little kitty."],
"Turkey Fact - Wattle":
["Turkey: Hey, it is time for another turkey fact.",
@ -656,8 +656,8 @@ var story = { @@ -656,8 +656,8 @@ var story = {
"Turkey: That's because a group of turkeys is called a gang.",
"Turkey: A turkey group may also be called a rafter.",
"Turkey: I'm more of a kayaker personally.",
"Cat: Get meowta here",
"Turkey: That pun was fowl",
"Cat: Get meowta here.",
"Turkey: That pun was fowl.",
"Cat: Purrrsonally, not as bad as yours.",
"Turkey: Gobble Gobble"]

186
js/ui.js

@ -51,16 +51,17 @@ function HelpUI( stage, gameState ){ @@ -51,16 +51,17 @@ function HelpUI( stage, gameState ){
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")
new createjs.Bitmap("res/screens/HelpCreditsScreen/HelpP7P8.png"),
new createjs.Bitmap("res/screens/HelpCreditsScreen/HelpP9P10.png")
];
var position = 0;
var position = 100;
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 = helpPages[ Math.abs(position) % 5 ];
helpImg.visible = true;
} else{
that.hideHelp();
@ -70,7 +71,7 @@ function HelpUI( stage, gameState ){ @@ -70,7 +71,7 @@ function HelpUI( stage, gameState ){
if( helpImg ){
position--;
helpImg.visible = false;
helpImg = helpPages[ Math.abs(position) % 4 ];
helpImg = helpPages[ Math.abs(position) % 5 ];
helpImg.visible = true;
} else {
that.hideHelp();
@ -269,6 +270,10 @@ function CookbookUI( stage, gameState ){ @@ -269,6 +270,10 @@ function CookbookUI( stage, gameState ){
var cookbookImg = new createjs.Bitmap("res/screens/KitchenScreen/Cookbook-Open.png");
var closeButton = new Button( stage, gameState, 710, 10, 100, 50, null, null, function(){that.hideCookbook();} );
var scrollUpBtn = new Button( stage, gameState, 710, 80, 100, 50, null, null, function(){that.scrollUp();} );
var scrollDownBtn = new Button( stage, gameState, 710, 540, 100, 50, null, null, function(){that.scrollDown();} );
var turkeyTypeText = new createjs.Text("", "18px Arial", "black" );
turkeyTypeText.x = 535;
turkeyTypeText.y = 56;
@ -276,24 +281,63 @@ function CookbookUI( stage, gameState ){ @@ -276,24 +281,63 @@ function CookbookUI( stage, gameState ){
var turkeyWeightText = new createjs.Text("", "18px Arial", "black" );
turkeyWeightText.x = 553;
turkeyWeightText.y = 85;
var hiddenEntries = [];
var logEntries = [];
this.hideCookbook = function(){
stage.removeChild( closeButton );
stage.removeChild( cookbookImg );
stage.removeChild( scrollUpBtn );
stage.removeChild( scrollDownBtn );
stage.removeChild( turkeyTypeText );
stage.removeChild(turkeyWeightText);
stage.removeChild( turkeyWeightText );
for( i in logEntries ){
stage.removeChild(logEntries[i]);
}
for( i in hiddenEntries ){
stage.removeChild(hiddenEntries[i]);
}
that.showingCookbook = false;
gameState.pubsub.publish("Play", "Close_Cookbook");
}
this.scrollDown = function(){
// move to hidden list
if( logEntries.length > 1 ){
// Move all entries up by 50 pixels
for( i in logEntries ){
logEntries[i].y -= 50;
}
var topEntry = logEntries.shift();
topEntry.alpha = 0;
hiddenEntries.push( topEntry );
}
}
this.scrollUp = function(){
// pop and fill in top
if( hiddenEntries.length > 0 ){
var topEntry = hiddenEntries.pop();
topEntry.alpha = 1;
logEntries.unshift( topEntry );
// shift everything down by 50 pixels
for( i in logEntries ){
logEntries[i].y += 50;
}
}
}
// Show core temperature
this.showCookbook = function(){
if( !that.showingCookbook ){
// TODO: So this object is actually persistent: we should not remove/add children, just hide stuff visually
logEntries = [];
stage.addChild( cookbookImg );
stage.addChild( closeButton );
@ -313,9 +357,13 @@ function CookbookUI( stage, gameState ){ @@ -313,9 +357,13 @@ function CookbookUI( stage, gameState ){
logEntries.push(logLine);
stage.addChild(logLine);
}
stage.addChild(turkeyTypeText);
stage.addChild(turkeyWeightText);
stage.addChild(scrollUpBtn);
stage.addChild(scrollDownBtn);
that.showingCookbook = true;
}
}
@ -476,7 +524,7 @@ function OvenUI( stage, gameState ){ @@ -476,7 +524,7 @@ function OvenUI( stage, gameState ){
gameState.pubsub.publish("Death","");
gameState.pubsub.publish( "ShowDialog", {seq:"custom", autoAdvance:true, customText:evalSkin[turkeyState["skin"]["cond"][2]] + "." } );
gameState.pubsub.publish( "AddRecord", {type:"Open ", text:"The turkey looked " + turkeyState["skin"]["cond"][2]} );
//gameState.ovenModel.setRawTemp( (gameState.ovenModel.getRawTemp() - 25) < 150 ? 150 : gameState.ovenModel.getRawTemp() - 25 );
gameState.ovenModel.setRawTemp( (gameState.ovenModel.getRawTemp() - 3 ) < 20 ? 20 : gameState.ovenModel.getRawTemp() - 3 );
gameState.ovenOpened++;
}
@ -548,8 +596,15 @@ function OvenUI( stage, gameState ){ @@ -548,8 +596,15 @@ function OvenUI( stage, gameState ){
this.secondTick = function(diff){
// check if oven door is open
if( that.ovenDoor == OVEN_OPEN ){
gameState.ovenModel.setRawTemp( (gameState.ovenModel.getRawTemp() - 1 ) < 20 ? 20 : gameState.ovenModel.getRawTemp() - 1 );
}
gameState.ovenModel.secondTick();
gameState.currentTime += diff;
if( gameState.turkeyBought ){
gameState.turkeyCookCounter++;
}
}
gameState.pubsub.subscribe( "SkipTime", function(){
@ -571,7 +626,6 @@ function OvenUI( stage, gameState ){ @@ -571,7 +626,6 @@ function OvenUI( stage, gameState ){
that.secondTick( diff );
if( gameState.turkeyBought ){
gameState.turkeyCookCounter++;
// what's the state of the turkey
turkeyState = gameState.ovenModel.getTurkeyState();
gameState.turkeyStates[0].alpha = 1;
@ -631,6 +685,10 @@ function OvenUI( stage, gameState ){ @@ -631,6 +685,10 @@ function OvenUI( stage, gameState ){
//finalize button
if( gameState.turkeyBought ){
stage.addChild( new Button( stage, gameState, 45, 250, 250, 150, null, null, function(){
if(!evalSkin[turkeyState["skin"]["cond"][2]]){
gameState.pubsub.publish("Death","");
return;
}
gameState.pubsub.publish("Play", "Error");
gameState.pubsub.publish("ShowFinalConfirm","");
} ) );
@ -662,68 +720,140 @@ function OvenUI( stage, gameState ){ @@ -662,68 +720,140 @@ function OvenUI( stage, gameState ){
function WindowUI( stage, gameState ){
var dayNight = new createjs.Bitmap("res/screens/Window/Test4-217.svg");
var mood = new createjs.Bitmap("res/screens/Window/Test4TransparencyFull.svg");
var dayNight = new createjs.Bitmap("res/screens/Window/Test4-217.png");
var mood = new createjs.Bitmap("res/screens/Window/Test4TransparencyFull.png");
var smallWindows= [ new createjs.Bitmap("res/screens/Window/Small1.png"),
new createjs.Bitmap("res/screens/Window/Small2.png"),
new createjs.Bitmap("res/screens/Window/Small3.png"),
new createjs.Bitmap("res/screens/Window/Small4.png"),
new createjs.Bitmap("res/screens/Window/Small5.png")
];
var windows= [ new createjs.Bitmap("res/screens/Window/Win1.png"),
new createjs.Bitmap("res/screens/Window/Win2.png"),
new createjs.Bitmap("res/screens/Window/Win3.png"),
new createjs.Bitmap("res/screens/Window/Win4.png"),
new createjs.Bitmap("res/screens/Window/Win5.png"),
new createjs.Bitmap("res/screens/Window/Win6.png"),
new createjs.Bitmap("res/screens/Window/Win7.png"),
new createjs.Bitmap("res/screens/Window/Win8.png"),
new createjs.Bitmap("res/screens/Window/Win9.png"),
new createjs.Bitmap("res/screens/Window/Win10.png"),
new createjs.Bitmap("res/screens/Window/Win11.png")
];
mood.y=30;
dayNight.y=30;
var secondCounter = 0;
mood.x = dayNight.x = -(new Date( gameState.currentTime ).getHours()*682.625);
var newpos = -(new Date( gameState.currentTime ).getHours()*682.625);
mood.x = dayNight.x = newpos < -15583 ? 0 : newpos;
var ground = new createjs.Bitmap( "res/screens/Window/Ground.png" );
var houses = new createjs.Bitmap( "res/screens/Window/Housefar.png" );
var streetLight = new createjs.Bitmap( "res/screens/Window/StreetlightGlow.png" );
streetLight.alpha = 0;
streetLight.alpha = 1;
var stars = new createjs.Bitmap( "res/screens/Window/Stars.png" );
stars.alpha = 1;
var treeAnimations = { rustle:[0,17,"rustle"], still:[0,0,"still"] };
var treeAnimations = { rustle:{ frames:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17], next:false } };
var data = {
images: ["res/screens/Window/Tree_Animation.png"],
frames: { width:386, height:287 },
animations: treeAnimations
};
var spriteSheet = new createjs.SpriteSheet(data);
var animation = new createjs.Sprite(spriteSheet, "treeAnimations");
var animation = new createjs.Sprite(spriteSheet);
animation.x = 415;
animation.y = 30;
// Fast forward, move sky
gameState.pubsub.subscribe( "SkipTime", function(){
var newpos = -(new Date( gameState.currentTime ).getHours()*682.625);
dayNight.x = mood.x =newpos < -15583 ? 0 : newpos;
dayNight.x = mood.x = newpos < -15583 ? 0 : newpos;
});
stage.addChild( dayNight );
stage.addChild( ground );
stage.addChild( houses );
stage.addChild( streetLight );
stage.addChild( stars );
stage.addChild( animation );
stage.addChild( mood );
for( var i in smallWindows ){
smallWindows[i].visible = UtilityFunctions.randRange(0,1);
stage.addChild( smallWindows[i] );
}
for( var i in windows ){
windows[i].visible = UtilityFunctions.randRange(0,1);
stage.addChild( windows[i] );
}
stage.addChild( streetLight );
return {
tick: function(){
// move the sky
secondCounter++;
if( secondCounter > 60 ){
if( secondCounter > 600 ){
dayNight.x-=11.38;
mood.x -= 11.38;
secondCounter = 0;
// move tree sometimes
if( UtilityFunctions.randRange(0,1) )
animation.gotoAndPlay("rustle");
// turn on lights
if( dayNight.x < 0 && dayNight.x > -4545 ){
for( var i in smallWindows ){
smallWindows[i].visible = UtilityFunctions.randRange(0,1);
}
for( var i in windows ){
windows[i].visible = UtilityFunctions.randRange(0,1);
}
// turn on random window lights
streetLight.alpha= 1;
stars.alpha = 1;
}
else if( dayNight.x < -11687 ){
for( var i in smallWindows ){
smallWindows[i].visible = UtilityFunctions.randRange(0,1);
}
for( var i in windows ){
windows[i].visible = UtilityFunctions.randRange(0,1);
}
streetLight.alpha= 1;
stars.alpha = 1;
}
// daytime, turn off all lights
else{
for( var i in smallWindows ){
smallWindows[i].visible = 0;
}
for( var i in windows ){
windows[i].visible = 0;
}
streetLight.alpha= 0;
stars.alpha = 0;
}
}
// if too many lights are causing an issue on your browser, turn them off
if( createjs.Ticker.getMeasuredFPS().toFixed(1) < 13 ){
for( var i in windows ){
windows[i].visible = 0;
}
}
if( dayNight.x < -15583 )
dayNight.x = 0;
// turn on lights
if( dayNight.x < 0 && dayNight.x > -4545 ){
// turn on random window lights
streetLight.alpha = 1;
}
else if( dayNight.x < -11687 ){
streetLight.alpha = 1;
}
else
streetLight.alpha = 0;
}
}
}
@ -829,7 +959,7 @@ function MarketItem( gameState, name, x, y, cost, mouseOutImg, mouseOverImg, mou @@ -829,7 +959,7 @@ function MarketItem( gameState, name, x, y, cost, mouseOutImg, mouseOverImg, mou
// if we bought a clock, enable it!
if( that.name.indexOf("Alarm") != -1 ) gameState.alarmBought = true;
if( that.name.indexOf("Frills") != -1 ) gameState.frillsModifier = 5;
if( that.name.indexOf("Frills") != -1 ) gameState.frillsModifier = 1.05;
if( that.name.indexOf("Exquisite") != -1 ){ gameState.stuffingTypeModifier = gameState.stuffingTypeModifier > 1.08 ? gameState.stuffingTypeModifier : 1.08; }
if( that.name.indexOf("Special") != -1 ){ gameState.stuffingTypeModifier = gameState.stuffingTypeModifier > 1.17 ? gameState.stuffingTypeModifier : 1.17; }

BIN
res/screens/HelpCreditsScreen/Credits.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 473 KiB

After

Width:  |  Height:  |  Size: 433 KiB

BIN
res/screens/HelpCreditsScreen/HelpP1P2.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 276 KiB

After

Width:  |  Height:  |  Size: 278 KiB

BIN
res/screens/HelpCreditsScreen/HelpP3P4.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 319 KiB

After

Width:  |  Height:  |  Size: 319 KiB

BIN
res/screens/HelpCreditsScreen/HelpP5P6.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 324 KiB

After

Width:  |  Height:  |  Size: 327 KiB

BIN
res/screens/HelpCreditsScreen/HelpP7P8.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 308 KiB

After

Width:  |  Height:  |  Size: 304 KiB

BIN
res/screens/HelpCreditsScreen/HelpP9P10.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 295 KiB

BIN
res/screens/KitchenScreen/Cookbook-Open.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 333 KiB

After

Width:  |  Height:  |  Size: 298 KiB

BIN
res/screens/KitchenScreen/TurkeyState1Small.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

BIN
res/screens/KitchenScreen/TurkeyState2Small.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
res/screens/KitchenScreen/TurkeyState3Small.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
res/screens/KitchenScreen/TurkeyState4Small.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

BIN
res/screens/KitchenScreen/TurkeyState5Small.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

BIN
res/screens/Window/Housefar.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 64 KiB

BIN
res/screens/Window/Stars.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
res/screens/Window/Test4-217.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
res/screens/Window/Test4TransparencyFull.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

76
sim/TurkeySimulation.m

@ -0,0 +1,76 @@ @@ -0,0 +1,76 @@
%for blog: take pictures of graphs of inside and outsite tempurature vs
%time and oven temperature, also temperature vs radius of a properly cooked turkey.
tic
init=0;
if init == 0
clear all
weight = 15/2.2;%lbs
density = 800;
% r0=.15;
r0 = (weight/density/4*3/pi)^(1/3);
deltar=r0/30;
r=[deltar*1:deltar:r0];
alpha = .412/2800/1000;
h=9; %nusselt number
k=.412+r*0;
% weight = r0^3*4*pi/3*density;
Tinf=600;
Ti=20;
T=Ti+r*0;
waterlost=r*0;
% T(end)=T(end)+1;
end
deltat = .1;
time=.6*60*60/deltat;%minutes
Tcenterlog=zeros(1,time);
Tlog=Tcenterlog;
for i = 1:time
dTtemp = (T(3:end)-T(1:end-2))./(2*deltar); %only works if r is linear
dTdr= [(T(2)-T(1))/deltar, dTtemp, (T(end)-T(end-1))/deltar];
% dTdr = diff(T)./diff(r);
% dTdr(end+1)=dTdr(end);
dTdr(end)= h*(Tinf-T(end))/k(end);
parenthesis=dTdr.*r.^2;
dPtemp = (parenthesis(3:end)-parenthesis(1:end-2))./(2*deltar); %again, linear only
dPdr = [(parenthesis(2)-parenthesis(1))/deltar, dPtemp, (parenthesis(end)-parenthesis(end-1))/deltar];
% dPdr = diff(parenthesis)./diff(r);
% dPdr(end+1) = dPdr(end);
% % if kout > k(end)
% % k(end)=(kout-k(end))/3+k(end);
% % end
% kout=h*(Tinf-T(end))/dTdr(end);
% k(end)=kout;
alpha = k/2800/density;
dTdt=alpha.*dPdr./r.^2;
% dTdt(1)=dTdt(1)/2;
T=T+dTdt*deltat;
waterlost=waterlost+(10.^((T-20)/80)-1)/10;
% Tcenterlog(i)=T(1);
% Tlog(i)=T(end);
end
figure(1)
plot(r,(T*1.8+32))
figure(2)
plot(r,waterlost)
% cooktime=[1:time]*deltat/3600;
% figure(2)
% hold on
% plot(cooktime,Tcenterlog*1.8+32)
% plot(cooktime,Tlog*1.8+32)
% toc
Loading…
Cancel
Save