Andgenerallyyou'llhaveallofyourjobscriptinonefolderandallofyourCSSandanotherfoldersorightnow, we'renotgonnaneedtoseethisfilestructureagain, so I'lljustclosethat, Okay?
Andletmejustreadjustthis a littlebitand I startgoingthroughthisHTMLheresoyoucanseefromhere.
Itsayseffectequals M boss, andthat's whyyoucankindofsee a borderaroundaroundthis.
It's embossedandghoulfontshaveallsortsofeffectsyoucanuse, so I wouldhighlyrecommendlookingupcoolfontsandtheeffectsifyou'renotalreadyfamiliarwiththemAndthenhereiswherewelinktoourCSSfile.
Francis, withthistoplefthere, if I goonhere, if I scrolldown, I willbeabletoseetopleft.
AndthisistheCSStocreatethisgreensectionhere.
Youcanevenseebackgroundisdarkgreenhere.
Theotherpurposeofthe I.
D.
S isthatwecanreferencetheminJavaScript.
And a lotofthesewearegonnareferenceinJavastrippedbecausewe'regoingtoaddclickhandlers, andwe'regoingtousejavascripttoshowwhat's goingtohappenwhenyouclickthedifferentelementsonthepage.
Sowealsohavethisinnercirclethat's thisgreycirclehere, andithas a bunchofstuffinsidetheinnercircleyoucanseenestledwithinthecircle.
Sowehavethetitleandyoucanseethatthere's a specialclassfontinfectinBoss.
You'reusuallygonnaendallyourlineswith a semicolon.
Letis a waytoinitialize a variable.
There's there's threedifferentwaystoinitialize a variableWehaveletwehavevarAndthenthere's Constandahofour I'm justgonnado a briefoverviewofwhatthedifferentthingsare.
Andso I'm goingtopassin a functionnowThisisgoingtobe, ah, anaerofunctionhere.
There's a couplewaystomakefunctionsinJavaScript, andthisis a commonwayforeventlistenerswherethisiswhatwe'regonnabepassingintothefunctionandyouputtheaeroequalandthenthe, um, morethansignandwehavehiscurlybraces.
Settimeoutisgoingtodosomethingonceafter a certainnumberofmilliseconds.
Soagain, I'm goingtouseoneofthesearrowfunctionsfrom E s sixandit's goingtorunthisfunctionafter a certainnumberofmilliseconds, so I'llputthemillisecondsattheend, so I haven't definedwhatthefunctionis, butyoucanseeherethat, umeveryforit's gonnawait 200 millisecondsandthendowhat's what's inhere.
Sowhat's inhereisit's goingtoflash a numberor a color.
Um, andactually, I'm gonnamakeonemorechangerightquickinsteadofourThiswillbe a Letalreadytoldyouthatthatwedon't reallyuseofouranymore.
It's gonnaplaythesound.
I'm gonnasetthenoisetoequal.
True, justincaseitwassettofalse.
Nowyou'llunderstandmoreofthisnoisethinglaterwhen I When I showyouwhenthenoisesettofalseandthentoptopleftthatstylethatbackgroundcolorequalslight, Corinne.
So I'm justgonnacopythis, andthat's gonnabe 234 So I'm gonnachangethistotoAndthisisclip, too.
Andthecolorisgonnabetomatonow, justsoyouknow, I couldbeusinghexcodesorsomeotherwaytoindicate a color, buthtMelhas a setofkeywordsthatyoucanusetospecifycertaincolors.
Sotomatois a keywordtosignify a specificcolorinjobin a c M l thatyouwillseesoonwhen I dotheexample.
Sothisisgonnabethree.
Andsetthatthree.
Um, foursaidthatfour, Thiscolorisgoingtobeyellow, andthenthiscolorisgoingtobe a lightskyblue.
Okay, I thinkwehaveenoughcodeheretodoanexample.
Soletmesavethatrefreshhere.
Andif I pressstart, okay, it's notworking.
Let's checktheconsole.
Clearcolorsnotdefined.
Oh, yeah.
So I I justspelledthiswrong.
Solet's see.
Clear a letterandthen I'llrefresh.
Nowlet's tryseeif I getanyclear, okay?
It's still I spellthewrong, Buttheanotherproblemisthat I actuallyneverfindthatfunction.
Solet's dothatrightnow.
I'm gonnagodownhereClearcolor.
Oh, toputthewordfunctionsofunctionclearcolor.
I'm gonnause a lineverysimilartothis.
Wheresaystopleft a stylethatbackgroundpoliticalslightgreen.
Andthenthenextthingthat's gonnahappenisthatwe'regonnaset a timeout, andthentheturncounterisgoingtobesetbacktotheturnnumber.
Soitwastheturncounterwassettoknow.
Butafter a certainamountofmillisecondsisgonnagobacktotheturnnumberandthenalso, we'regoingtoclearthecolor.
Sowe'reflashingthecolorhere, andthenwe'regonnaclearthecolorhereafter a certainnumberofmilliseconds, and I'lljustputthosemilliseconds, whichisgonnabe 800 milliseconds.
Soifstrictitforinstrictmodeand I called a playfunctionandwhenherplayfunctionisjustlikerepeatingthewholegame, startingthegameoverwithelse, ifwe'renotinstrictmode, thenwecanrepeattheround.
Goodequalstruebecausewenowwe'rebacktohavingnothingwrongbecausetherounditjuststartedandanellipseinterval I d equalssetinterval.
Sowe'resettingWe'restartingthisjustlikewedidbeforeintheplayfunctioniswith a setintervalbycallinggameturnwith 800 every 800 millisecondsAndthenthefinalthingthat's gonnabeinthisfunctionisnoiseequalsfalse.