diff --git a/index.html b/index.html index b989813..b30900d 100644 --- a/index.html +++ b/index.html @@ -12,7 +12,7 @@ - + @@ -22,22 +22,6 @@ diff --git a/js/dialogue.js b/js/dialogue.js index f8a88d0..c14b752 100644 --- a/js/dialogue.js +++ b/js/dialogue.js @@ -68,7 +68,7 @@ function DialogUI( stage, gameState ){ this.endFunc = function(){}; this.showDialog= function( textSeq ){ - console.log("showing"+ textSeq); + if(DEBUG) console.log("showing"+ textSeq); if( !peopleImg["Me"] ){ peopleImg["Me"] = peopleImg[gameState.gender]; } @@ -112,7 +112,7 @@ function DialogUI( stage, gameState ){ // check if there is something going on if( !that.currDialogueSeq.more() ){ - console.log("random story"); + if(DEBUG) console.log("random story"); this.showDialog( {seq: dialogueList[ randomKey ] || "Dad Tells a bad Joke", autoAdvance:true } ); delete story[ dialogueList[ randomKey ] ]; gameState.dialogueHeard++; @@ -136,7 +136,7 @@ function DialogUI( stage, gameState ){ that.dialogMotionQueue.push(DIALOG_SHOWING); that.textContent.text=nextDialogue[1]; - console.log("showing face:" +nextDialogue[0] ); + if(DEBUG) console.log("showing face:" +nextDialogue[0] ); // swap out face immediately that.currentFace.y = 250; @@ -175,13 +175,13 @@ function DialogUI( stage, gameState ){ that.dialogBox.y+=that.dialogSpeed; that.textContent.y += that.dialogSpeed; that.currentFace.y += that.dialogSpeed; - //console.log( "Receding" + that.dialogBox.y ); + //if(DEBUG) console.log( "Receding" + that.dialogBox.y ); } if( that.dialogState == DIALOG_SHOWING ){ that.dialogBox.y-=that.dialogSpeed; that.textContent.y -= that.dialogSpeed; that.currentFace.y -= that.dialogSpeed; - //console.log( "Advancing" + that.dialogBox.y ); + //if(DEBUG) console.log( "Advancing" + that.dialogBox.y ); } // toggle states @@ -190,7 +190,7 @@ function DialogUI( stage, gameState ){ that.textContent.y = 735; that.currentFace.y = 250; that.dialogState = DIALOG_PAUSING; - //console.log( "Pausing on recede" + that.dialogBox.y ); + //if(DEBUG) console.log( "Pausing on recede" + that.dialogBox.y ); } if( that.dialogBox.y < 0 && that.dialogState == DIALOG_SHOWING ){ @@ -198,7 +198,7 @@ function DialogUI( stage, gameState ){ that.textContent.y = 480; that.currentFace.y = 0; that.dialogState = DIALOG_PAUSING; - //console.log( "Pausing on showing" + that.dialogBox.y ); + //if(DEBUG) console.log( "Pausing on showing" + that.dialogBox.y ); } /* next states if there are any on the queue */ diff --git a/js/main.js b/js/main.js index 3a94f05..0e07431 100644 --- a/js/main.js +++ b/js/main.js @@ -1,5 +1,7 @@ // Robert- Here be dragons +var DEBUG = 1; + function GameState(){ var that = this; @@ -355,7 +357,7 @@ function GameUI( canvasElem, gameState ){ var textContent = new createjs.Text( "", "20px Arial", "black" ); textContent.x = 750; textContent.y = 30; - this.stage.addChild( textContent); + //this.stage.addChild( textContent); var overlay = new createjs.Shape(); overlay.graphics.beginFill("#fffffff").drawRect(0, 0, 800, 600 ); overlay.alpha = 0; @@ -367,13 +369,13 @@ function GameUI( canvasElem, gameState ){ this.switchScreen = function( screenName ){ gameState.screenState = SCREEN_OUT; dialogManager.minDialog(); - console.log("Switch screen called with" + screenName); + if(DEBUG) console.log("Switch screen called with" + screenName); gameState.newScreen = screenName; }; this.actuallySwitchScreen = function( screenName ){ that.stage.removeAllChildren(); that.activeScreenObj = new that.screens[ screenName ]( that.stage, gameState ); - that.stage.addChild( textContent ); + //that.stage.addChild( textContent ); that.stage.addChild( overlay ); dialogManager.render(); }; diff --git a/js/model.js b/js/model.js index 86e3d4f..3bc02ea 100644 --- a/js/model.js +++ b/js/model.js @@ -21,7 +21,7 @@ function TurkeyLayer( name, percentRadius, turkeyModel, ovenModel ){ ovenModel.globalTime ); that.waterLost = that.waterLost + UtilityFunctions.waterLoss( that.finalTemperature ); that.cookCondition = UtilityFunctions.cookCondition(that.waterLost); - console.log( that.name + ": "+ that.waterLost + " " + that.cookCondition); + if(DEBUG) console.log( that.name + ": "+ that.waterLost + " " + that.cookCondition); }, resetLayerTemps: function(){ that.initialTemp = that.finalTemperature; @@ -118,12 +118,12 @@ function OvenModel( turkeyWeight, gameState ) { }; }, changeTemp: function(setTemp){ - console.log("temp changed to " + setTemp); + if(DEBUG) console.log("temp changed to " + setTemp); that.setTemp = setTemp; }, // set the tempInfini setRawTemp: function(newTemp){ - console.log("raw temp changed to" + that.tempInfini); + if(DEBUG) console.log("raw temp changed to" + that.tempInfini); that.tempInfini = newTemp; }, getRawTemp: function(){ @@ -145,9 +145,9 @@ function OvenModel( turkeyWeight, gameState ) { // Turn off oven light gameState.pubsub.publish( "OvenLight", "Off" ); } - console.log("Steady Temp " + that.steadyTemp) - console.log("Steady Timer " + that.steadyTimer) - console.log("Oven Temp " + that.tempInfini ) + 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(); } } @@ -174,8 +174,8 @@ UtilityFunctions = { var rectangleVolume = depth*height*length; //m^3 Multiple by 1/4 to account for triangular shape and empty Space var complexRadius = Math.pow(rectangleVolume/((4/3)*Math.PI), 1/3); //Volume of 3D Box = 3D Sphere - //console.log("Simple Radius " + simpleRadius + " Meters") - //console.log("Complex Radius " + complexRadius + " Meters") + //if(DEBUG) console.log("Simple Radius " + simpleRadius + " Meters") + //if(DEBUG) console.log("Complex Radius " + complexRadius + " Meters") return complexRadius; }, @@ -193,7 +193,7 @@ UtilityFunctions = { } } else { - //console.log("No Bracketed Root " + negativeTest) + //if(DEBUG) console.log("No Bracketed Root " + negativeTest) } } return storage; @@ -248,20 +248,20 @@ UtilityFunctions = { var frontCoefficientPortion; - //console.log("Alpha is " + alpha) + //if(DEBUG) console.log("Alpha is " + alpha) var Fourier = (alpha*t)/Math.pow(rTotal,2) - //console.log("Fourier is " + Fourier) + //if(DEBUG) console.log("Fourier is " + Fourier) var biotNum = heatConvection * rTotal/thermalConduct if ( biotNum != this.cachedBiot ) { - console.log("Recalculating Lambda Terms") + if(DEBUG) console.log("Recalculating Lambda Terms") this.cachedLambda = this.findAllRoots(min,max,max*Math.PI*10,biotNum) this.cachedBiot = biotNum; } - //console.log("The Biot Value is " + biotNum) + //if(DEBUG) console.log("The Biot Value is " + biotNum) for (var i = 0; i