From 5a7d943aa71e9ea1edbce5c94aab5c3df96e62a6 Mon Sep 17 00:00:00 2001 From: rsninja722 Date: Sun, 19 Apr 2020 12:04:57 -0400 Subject: [PATCH] tutorial --- docs/assets/images/Capture.PNG | Bin 685 -> 0 bytes docs/assets/images/tutArrow.png | Bin 0 -> 191 bytes docs/assets/images/tutKeyC.png | Bin 0 -> 200 bytes docs/assets/images/tutKeyX.png | Bin 0 -> 212 bytes docs/assets/images/tutKeyZ.png | Bin 0 -> 230 bytes docs/assets/images/tutSelect0.png | Bin 0 -> 209 bytes docs/assets/images/tutSelect1.png | Bin 0 -> 192 bytes docs/assets/js/UI/ui.js | 92 ++++++++++--------- docs/assets/js/constants.js | 2 +- docs/assets/js/index.js | 20 ++--- docs/assets/js/player/lifeFunctions.js | 69 ++++++++++----- docs/assets/js/playing/playing.js | 118 +++++++++++++++++++++++++ 12 files changed, 221 insertions(+), 80 deletions(-) delete mode 100644 docs/assets/images/Capture.PNG create mode 100644 docs/assets/images/tutArrow.png create mode 100644 docs/assets/images/tutKeyC.png create mode 100644 docs/assets/images/tutKeyX.png create mode 100644 docs/assets/images/tutKeyZ.png create mode 100644 docs/assets/images/tutSelect0.png create mode 100644 docs/assets/images/tutSelect1.png diff --git a/docs/assets/images/Capture.PNG b/docs/assets/images/Capture.PNG deleted file mode 100644 index 538afbbfbf40b8ec085595a0cf3cdf9d0e49180c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 685 zcmeAS@N?(olHy`uVBq!ia0vp^XMotBgAGV7XVYo{Qk(@Ik;M!Qe1}1p@p%4<6b1&S zcuyC{kcv5P@9gyxNfc>#Xngw9^2Q@c+)~LpI(H6U|7Mb(cEV5N*Wb<}0}HMn*VpFe z^i{RK;9+yW_};&#ihqY#SBHkOlgXd!_sna$qU`tYE^XV$v!yjb!O>uXf`o?vj|vBy z5DPPBQzOekhbHX8PUTm)4@{jQe=e29**eE`PJOJb+)4Zfe9)6zyWzvCn}0s}lybF& z-S~GUr|zd?X_ZPdZflytlQUX>S|8romyprAR{iX=>wlH)PYA`?{;qXzw7OvY zF2VBs(>EGN9$B29x@T|Xk-dkF?EFM8TKCH90jUrp2el=-X#)m>fQFX`F)?rHk< z-B)&B-R;)0_wC=)d+(nqOG@7)5oPesU_wD*d*w~(-#?e{T^;k(+-UcW-8;?R{1va^ zch+9B&TRJlIcxn6Uf}Zf2D;vCRj|R9LysO6tW%bVN=#jPv*vGBPeMj}Yuo4ZtDFtC z94?AZys-$y?m7gUs3H!+Yc_&1}3oUol*%f&yy P^vB@o>gTe~DWM4ffE*Ln diff --git a/docs/assets/images/tutArrow.png b/docs/assets/images/tutArrow.png new file mode 100644 index 0000000000000000000000000000000000000000..e5b425973a287d8516a634e7366ba755bec6e40b GIT binary patch literal 191 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+1|-AI^@RheHcuDF5DWk0lm$WwOD0+JMDR|U znD~=_(}Rw`1GEF2PkIISgtk+nL{O7WM}^jlt8^&t;ucLK6T1Jx3}4 literal 0 HcmV?d00001 diff --git a/docs/assets/images/tutKeyX.png b/docs/assets/images/tutKeyX.png new file mode 100644 index 0000000000000000000000000000000000000000..235091d2a5e6e12ddb678c57661b84243d1cc023 GIT binary patch literal 212 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+1|-AI^@Rhe*`6+rAr}70DGd$(17^i^O%zN! zvA25p2_qNJlRRtqa{|J{O`RhnwV7A8HS#pRT)NiL;Q6B601 zo*>oR+k3FF^4pt8gWfk@O?pkP@fjIvcNiu#t`7Hi?~ME<8bg K=d#Wzp$PyIKTQ?@ literal 0 HcmV?d00001 diff --git a/docs/assets/images/tutKeyZ.png b/docs/assets/images/tutKeyZ.png new file mode 100644 index 0000000000000000000000000000000000000000..39a8a88e75465187707704b47691c311fadef909 GIT binary patch literal 230 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+1|-AI^@RhewVp1HAr}70DGd$(17^i^O%zN! zvA25p2_qNJlRRtqa{|J{O`RhnwV7A8HS#pRJennNMl8m!CDOybdBaW>6BA*bns09+ zD+B~e1UEUJU~4$i+uJJ{wtgO8n9~%;8$1k|ZIVESg0n+h!%l{~3^TepcX2FXc)}XP zHX%h|-xW)XMe?(`Iokv`&g5I}ctomU4PSN~Gv_2G2T9qZ3KPX+r?b<@%&Dp!x=nX{an^LB{Ts5c}h-t literal 0 HcmV?d00001 diff --git a/docs/assets/images/tutSelect0.png b/docs/assets/images/tutSelect0.png new file mode 100644 index 0000000000000000000000000000000000000000..5fc4a7ce4186c034bc795f432c2cbd346862188a GIT binary patch literal 209 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+1|-AI^@Rhe8J;eVAr}70DF>KSQX>8-d)rrj zY8RYdv_{B)`Ptdaju)p-DPcWxJWZj^QNj5FuR}TO35SxyAEa1{8P6!pV6EV7s$@?Q zHj=(+`r}GNY|9(joNWuMd1qI>l5|;>ov_aNIy)bKO=E}lT^`0}w)i!Q$C-5GC(c#4 z7_48UqjXwus_TZO{4s(4A?K+mNkT^KaGcoB0ml;D($)5kur+sk;x{<-t)z4*} HQ$iB}?|(}# literal 0 HcmV?d00001 diff --git a/docs/assets/images/tutSelect1.png b/docs/assets/images/tutSelect1.png new file mode 100644 index 0000000000000000000000000000000000000000..21cb3a716bbca6cfe24c9cc62c5b16bda3c0baeb GIT binary patch literal 192 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`?Vc`=-nCYtc>-^vbVHu;8MhgX2F({^namh& zrp5RjO=CQv8o_%&G~tCGbacOY`iJSaBb6^wR!tqivgX);OXk;vd$@?2>>q&K*<0A literal 0 HcmV?d00001 diff --git a/docs/assets/js/UI/ui.js b/docs/assets/js/UI/ui.js index 8bb34a7..c727600 100644 --- a/docs/assets/js/UI/ui.js +++ b/docs/assets/js/UI/ui.js @@ -3,16 +3,22 @@ function drawTitleScreenUI() { } +var playingUIOffsets = { + heart: 100, + breath: 100, + blink: 100 +}; + // UI for playing function drawPlayingUI() { // cartesianRect(0,ch/3*2, cw, ch/3, "#333333") //Heart Rate Monitor - heartBeatUI(cw/4*3-8,ch/8*7-8,cw/4,ch/8); + heartBeatUI(cw / 4 * 3 - 8, ch / 8 * 7 - 8 + playingUIOffsets.heart, cw / 4, ch / 8); //Respiration Monitor - respiratoryUI(cw/8*5,ch/8*7-8, cw/16, ch/8); + respiratoryUI(cw / 8 * 5, ch / 8 * 7 - 8 + playingUIOffsets.breath, cw / 16, ch / 8); //Blink eye and overlay blinkUI(); @@ -33,9 +39,9 @@ function drawEndUI() { * */ -function respiratoryUI(x, y, width, height){ - cartesianRect(x,y,width,height, "rgb("+noBreathTimer/180*255+","+0+","+0+")"); - cartesianRect(x,y+(height-breath/constants.lifeFuncs.breath.fullBreath*height), width, breath/constants.lifeFuncs.breath.fullBreath*height, "rgb("+255+","+(255-fullBreathTimer/180*255)+","+(255-fullBreathTimer/180*255)+")"); +function respiratoryUI(x, y, width, height) { + cartesianRect(x, y, width, height, "rgb(" + noBreathTimer / 180 * 255 + "," + 0 + "," + 0 + ")"); + cartesianRect(x, y + (height - breath / constants.lifeFuncs.breath.fullBreath * height), width, breath / constants.lifeFuncs.breath.fullBreath * height, "rgb(" + 255 + "," + (255 - fullBreathTimer / 180 * 255) + "," + (255 - fullBreathTimer / 180 * 255) + ")"); } /*** @@ -46,8 +52,8 @@ function respiratoryUI(x, y, width, height){ //Heart rate monitor history let heartBeatHistory = []; - heartBeatHistory.length = constants.ui.heartRate.history_length; - heartBeatHistory.fill(0); +heartBeatHistory.length = constants.ui.heartRate.history_length; +heartBeatHistory.fill(0); //Shift accumulation let shiftAccum = 0; @@ -56,12 +62,12 @@ let shiftAccum = 0; let beatTimeElapsed = Infinity; // Draw heartbeat UI -function heartBeatUI(x, y, width, height){ +function heartBeatUI(x, y, width, height) { //Shift monitor over once a full scrolling unit is accumulated shiftAccum += constants.ui.heartRate.scroll_speed; - if(shiftAccum>=1){ - shiftAccum%=1; + if (shiftAccum >= 1) { + shiftAccum %= 1; beatTimeElapsed += 0.04; //Remove oldest value @@ -72,70 +78,70 @@ function heartBeatUI(x, y, width, height){ } //If heart is beaten, reset beat timer. - if(heartBeat){ + if (heartBeat) { beatTimeElapsed = 0; heartBeat = false; } //Backdrop var BackdropColor; - if(pressure > 42 && pressure < 60) { + if (pressure > 42 && pressure < 60) { BackdropColor = "#0c2605"; - } else if(pressure > 28 && pressure < 75) { + } else if (pressure > 28 && pressure < 75) { BackdropColor = "#2b2b06"; } else { BackdropColor = "#260505"; } - rect(x+width/2,y+height/2,width,height,BackdropColor); - img(sprites.heartBack,cw-107,ch-46); + rect(x + width / 2, y + height / 2, width, height, BackdropColor); + img(sprites.heartBack, cw - 107, ch - 46 + playingUIOffsets.heart); //Pressure Meter - rect(x+width-8,y+height/2,16,height,"red"); - rect(x+width-8,y+height/2,16,height/2,"yellow"); - rect(x+width-8,y+height/2,16,height/6,"green"); - let pressureHeight = Math.max(Math.min(y+height-(pressure/constants.lifeFuncs.cardio.optimalPressure*height/2),y+height),y); - line(x+width-16, pressureHeight,x+width,pressureHeight, 2,"black") + rect(x + width - 8, y + height / 2, 16, height, "red"); + rect(x + width - 8, y + height / 2, 16, height / 2, "yellow"); + rect(x + width - 8, y + height / 2, 16, height / 6, "green"); + let pressureHeight = Math.max(Math.min(y + height - (pressure / constants.lifeFuncs.cardio.optimalPressure * height / 2), y + height), y); + line(x + width - 16, pressureHeight, x + width, pressureHeight, 2, "black") //Graph for (let index = 0; index < heartBeatHistory.length; index++) { const qrsValueAtPosition = heartBeatHistory[index]; - const qrsValueAtNextPosition = heartBeatHistory[index+1]; - line(x+(index*(width-16)/heartBeatHistory.length), y+(2*height/3)+(qrsValueAtPosition*(width-16)/heartBeatHistory.length), x+((index+1)*(width-16)/heartBeatHistory.length), y+(2*height/3)+(qrsValueAtNextPosition*(width-16)/heartBeatHistory.length),Math.min(3,Math.max(3/beatTimeElapsed,1)), "red"); + const qrsValueAtNextPosition = heartBeatHistory[index + 1]; + line(x + (index * (width - 16) / heartBeatHistory.length), y + (2 * height / 3) + (qrsValueAtPosition * (width - 16) / heartBeatHistory.length), x + ((index + 1) * (width - 16) / heartBeatHistory.length), y + (2 * height / 3) + (qrsValueAtNextPosition * (width - 16) / heartBeatHistory.length), Math.min(3, Math.max(3 / beatTimeElapsed, 1)), "red"); } // cover - img(sprites.heartCover,cw-107,ch-46); + img(sprites.heartCover, cw - 107, ch - 46 + playingUIOffsets.heart); } //Determine next value to be added to the graph -function pushNextBeatValue(){ +function pushNextBeatValue() { let nextBeatValue = 0; //Timespan of one "square" on the EKG const squareSize = constants.ui.heartRate.square_size; //Length of full complex - const complexTime = constants.ui.heartRate.complex_width*squareSize; + const complexTime = constants.ui.heartRate.complex_width * squareSize; //Length of PR segment of complex - const prTime = constants.ui.heartRate.pr_width*squareSize; + const prTime = constants.ui.heartRate.pr_width * squareSize; //Length of QRS component of complex - const qrsTime = constants.ui.heartRate.qrs_width*squareSize; + const qrsTime = constants.ui.heartRate.qrs_width * squareSize; //Length of QT component of complex - const qtTime = constants.ui.heartRate.qt_width*squareSize; + const qtTime = constants.ui.heartRate.qt_width * squareSize; - if(beatTimeElapsed<=complexTime) { + if (beatTimeElapsed <= complexTime) { //PR Segment if (beatTimeElapsed <= prTime) { - nextBeatValue = 0.5*(Math.pow((beatTimeElapsed/squareSize - (prTime/2/squareSize)), 2)) - 2; + nextBeatValue = 0.5 * (Math.pow((beatTimeElapsed / squareSize - (prTime / 2 / squareSize)), 2)) - 2; } else if (beatTimeElapsed > prTime + squareSize && beatTimeElapsed <= prTime + squareSize + (qrsTime / 4)) { //QRS Segment pt. 1 - nextBeatValue = -4 + beatTimeElapsed/squareSize; + nextBeatValue = -4 + beatTimeElapsed / squareSize; } else if (beatTimeElapsed > prTime + squareSize + qrsTime / 4 && beatTimeElapsed <= prTime + squareSize + qrsTime / 2) { //QRS Segment pt. 2 - nextBeatValue = -14 * (beatTimeElapsed/squareSize - 4.5) - 0.5; - } else if (beatTimeElapsed > prTime + squareSize + qrsTime / 2 && beatTimeElapsed <= prTime + squareSize + (3*qrsTime / 4)) { //QRS Segment pt. 3 - nextBeatValue = 7 * (beatTimeElapsed/squareSize - 5) - 6.5; - } else if (beatTimeElapsed > prTime + squareSize + (3*qrsTime / 4) && beatTimeElapsed <= prTime + squareSize + qrsTime) { //QRS Segment pt. 4 - nextBeatValue = 2 * (beatTimeElapsed/squareSize - 6); - } else if (beatTimeElapsed > prTime + squareSize*2 + qrsTime && beatTimeElapsed <= prTime + squareSize*2 + qrsTime + qtTime) { //PT Segment - nextBeatValue = 0.5 * Math.pow((beatTimeElapsed/squareSize - (prTime + squareSize*2 + qrsTime + qtTime/2)/squareSize),2) - 3; + nextBeatValue = -14 * (beatTimeElapsed / squareSize - 4.5) - 0.5; + } else if (beatTimeElapsed > prTime + squareSize + qrsTime / 2 && beatTimeElapsed <= prTime + squareSize + (3 * qrsTime / 4)) { //QRS Segment pt. 3 + nextBeatValue = 7 * (beatTimeElapsed / squareSize - 5) - 6.5; + } else if (beatTimeElapsed > prTime + squareSize + (3 * qrsTime / 4) && beatTimeElapsed <= prTime + squareSize + qrsTime) { //QRS Segment pt. 4 + nextBeatValue = 2 * (beatTimeElapsed / squareSize - 6); + } else if (beatTimeElapsed > prTime + squareSize * 2 + qrsTime && beatTimeElapsed <= prTime + squareSize * 2 + qrsTime + qtTime) { //PT Segment + nextBeatValue = 0.5 * Math.pow((beatTimeElapsed / squareSize - (prTime + squareSize * 2 + qrsTime + qtTime / 2) / squareSize), 2) - 3; } } @@ -145,16 +151,16 @@ function pushNextBeatValue(){ function blinkUI() { // eye - img(sprites.eye,cw-350,ch-40,0,2,2); - var alpha = clamp(eyeDryness / constants.lifeFuncs.blink.dryTime,0,1); + img(sprites.eye, cw - 350, ch - 40 + playingUIOffsets.blink, 0, 2, 2); + var alpha = clamp(eyeDryness / constants.lifeFuncs.blink.dryTime, 0, 1); curCtx.globalAlpha = alpha; - img(sprites.eyeDry,cw-350,ch-40,0,2,2); + img(sprites.eyeDry, cw - 350, ch - 40 + playingUIOffsets.blink, 0, 2, 2); // dry overlay - if(eyeDryness > constants.lifeFuncs.blink.dryTime) { + if (eyeDryness > constants.lifeFuncs.blink.dryTime) { alpha = (eyeDryness - constants.lifeFuncs.blink.dryTime) / 350; curCtx.globalAlpha = alpha; - img(sprites.blinkOverlay,cw/2,ch/2); + img(sprites.blinkOverlay, cw / 2, ch / 2); } curCtx.globalAlpha = 1; diff --git a/docs/assets/js/constants.js b/docs/assets/js/constants.js index 9dd1a8a..b1d2653 100644 --- a/docs/assets/js/constants.js +++ b/docs/assets/js/constants.js @@ -58,7 +58,7 @@ var constants = { offset_x: 20, offset_y: 35 }, - defaultX: 500, + defaultX: 600, defaultY: -170 } diff --git a/docs/assets/js/index.js b/docs/assets/js/index.js index 2f441f9..447a897 100644 --- a/docs/assets/js/index.js +++ b/docs/assets/js/index.js @@ -10,7 +10,13 @@ images = [ "heartBack.png", "blinkOverlay.png", "eye.png", - "eyeDry.png" + "eyeDry.png", + "tutSelect0.png", + "tutSelect1.png", + "tutArrow.png", + "tutKeyZ.png", + "tutKeyX.png", + "tutKeyC.png" ]; audio = [ @@ -77,17 +83,7 @@ function draw() { break; // playing case globalStates.playing: - if(!justBlinked) { - - camera.zoom = 1; - imgIgnoreCutoff(sprites.epic,0,0); - drawWorldBlocks(); - player.draw(); - - } else { - rect(-camera.x - difx + cw/2,-camera.y - dify + ch/2,cw,ch,"black"); - justBlinked = false; - } + drawPlaying(); break; // paused case globalStates.paused: diff --git a/docs/assets/js/player/lifeFunctions.js b/docs/assets/js/player/lifeFunctions.js index bbc1f01..5efa7ac 100644 --- a/docs/assets/js/player/lifeFunctions.js +++ b/docs/assets/js/player/lifeFunctions.js @@ -1,8 +1,8 @@ -let breath = 180; +let breath = 200; let fullBreathTimer = 0; let noBreathTimer = 0; -let pressure = 50; +let pressure = 55; let heartBeat = false; @@ -11,33 +11,54 @@ var breathMode = { exhale: 1 }; -let currentBreathMode = breathMode.exhale; +let currentBreathMode = breathMode.inhale; let eyeDryness = 0; let justBlinked = false; function updateLife() { - - if(keyDown[k.x]) { - if(breath === 0) currentBreathMode = breathMode.inhale; - else if(breath === constants.lifeFuncs.breath.fullBreath) currentBreathMode = breathMode.exhale; + + if (playingUIOffsets.breath === 0) { + if (keyDown[k.x]) { + if (breath === 0) currentBreathMode = breathMode.inhale; + else if (breath === constants.lifeFuncs.breath.fullBreath) currentBreathMode = breathMode.exhale; + if(Date.now() - keyPromptTime > 3000) { + --keyPrompts.breath; + if(keyPrompts.breath > 0) { + keyPromptTime = Date.now(); + } + } + } + + breathe(); } - breathe(); + if (playingUIOffsets.heart === 0) { + if (keyPress[k.c]) { + heartbeat(); + if(Date.now() - keyPromptTime > 1250) { + --keyPrompts.beat; + if(keyPrompts.beat > 0) { + keyPromptTime = Date.now(); + } + } + } - if(keyPress[k.c]) { - heartbeat(); + pressure -= 0.1; + if (pressure <= 0) { + pressure = 0; + } } - pressure-=0.1; - if(pressure<=0){ - pressure = 0; - } + if(playingUIOffsets.blink === 0) { + eyeDryness++; - eyeDryness++; - - if(keyPress[k.z]) { - blink(); + if (keyPress[k.z]) { + blink(); + if(Date.now() - keyPromptTime > 1250) { + --keyPrompts.blink; + } + } } }; @@ -45,10 +66,10 @@ function breathe() { switch (currentBreathMode) { case breathMode.inhale: breath += 1; - if(breath >= constants.lifeFuncs.breath.fullBreath) { + if (breath >= constants.lifeFuncs.breath.fullBreath) { breath = constants.lifeFuncs.breath.fullBreath; fullBreathTimer++; - if(fullBreathTimer >= 600) { + if (fullBreathTimer >= 600) { //cough and lose breath or something } } else { @@ -57,10 +78,10 @@ function breathe() { break; case breathMode.exhale: breath -= 2; - if(breath <= 0) { + if (breath <= 0) { breath = 0; noBreathTimer++; - if(noBreathTimer >= 300) { + if (noBreathTimer >= 300) { //cough and lose breath or something } } else { @@ -71,8 +92,8 @@ function breathe() { }; function heartbeat() { - pressure+=10; - if(pressure>=100){ + pressure += 10; + if (pressure >= 100) { pressure = 100; } heartBeat = true; diff --git a/docs/assets/js/playing/playing.js b/docs/assets/js/playing/playing.js index 006c491..9f9aab7 100644 --- a/docs/assets/js/playing/playing.js +++ b/docs/assets/js/playing/playing.js @@ -1,8 +1,126 @@ +var tutorialStates = { + selectLeg:0, + placeOnGround:1, + goDownStairs:2, + getCereal: 3, + getMail: 4 +}; + +var tutState = tutorialStates.selectLeg; + +// how many times +var keyPrompts = { + beat: 2, + breath: 2, + blink: 1 +}; + +var keyPromptTime; + +var frameCount = 0; + function handlePlaying() { // enter build mode if(keyPress[k.BACKSLASH]) { globalState = globalStates.building; } + switch(tutState) { + case tutorialStates.selectLeg: + if(player.shouldMoveLeg) { + tutState = tutorialStates.placeOnGround; + } + break; + case tutorialStates.placeOnGround: + if(!player.shouldMoveLeg) { + tutState = tutorialStates.goDownStairs; + } + break; + case tutorialStates.goDownStairs: + if(player.y > -55) { + tutState = tutorialStates.getCereal; + keyPromptTime = Date.now(); + } + break; + case tutorialStates.getCereal: + break; + case tutorialStates.getMail: + + break; + } + + // rise heart ui + if(player.y > -55) { + if(playingUIOffsets.heart > 0) { + --playingUIOffsets.heart; + } + } + + // rise breath ui + if(player.y > 135) { + if(playingUIOffsets.breath > 0) { + --playingUIOffsets.breath; + } + } + + // rise blink ui + if(player.x < -290) { + if(playingUIOffsets.blink > 0) { + --playingUIOffsets.blink; + } + } + updateLife(); +} + +function drawPlaying() { + frameCount++; + if(!justBlinked) { + + imgIgnoreCutoff(sprites.epic,0,0); + // drawWorldBlocks(); + player.draw(); + + // beat key + if(keyPrompts.beat > 0 && playingUIOffsets.heart === 0) { + if(Date.now() - keyPromptTime > 1250) { + img(sprites.tutKeyC,player.x + 70, player.y + (~~(frameCount/10)%2) * 2,0,2,2); + } + } + + // breath key + if(keyPrompts.breath > 0 && playingUIOffsets.breath === 0) { + if(Date.now() - keyPromptTime > 3000) { + img(sprites.tutKeyX,player.x + 70, player.y + (~~(frameCount/10)%2) * 2,0,2,2); + } + } + + // blink key + if(keyPrompts.blink > 0 && playingUIOffsets.blink === 0) { + if(Date.now() - keyPromptTime > 4000) { + img(sprites.tutKeyZ,player.x + 70, player.y + (~~(frameCount/10)%2) * 2,0,2,2); + } + } + switch(tutState) { + case tutorialStates.selectLeg: + img(sprites["tutSelect"+~~(frameCount/10)%2],(player.leftLeg.x+player.leftLeg.x2)/2,(player.leftLeg.y+player.leftLeg.y2)/2,0,2,2); + break; + case tutorialStates.placeOnGround: + img(sprites["tutSelect"+~~(frameCount/10)%2],500,-40,2,2); + break; + case tutorialStates.goDownStairs: + img(sprites.tutArrow,360+~~(frameCount/10)%2,-30-~~(frameCount/10)%2,0,2,2); + break; + case tutorialStates.getCereal: + + break; + case tutorialStates.getMail: + + break; + } + } else { + rect(-camera.x - difx + cw/2,-camera.y - dify + ch/2,cw,ch,"black"); + justBlinked = false; + } + } \ No newline at end of file