We'realsogonnawant a stylesheetforstyleinourpagesaswellaslastly, a gamedotJswhichisgoingtostoreallovercodefortheJavascriptforourgame, whichisthebulkofthisvideo.
Creativewiththeclassofcontainerjustlikethisandinsideofhere, we'regonnaneed a diffwhichisgoingtohavean I D, whichistext, andit's justgoingtocontainourtext.
Thisisgoingtobethisfirstsectionuphereandthenwe'regonnaneed a anothercontainer, whichisgonnabe a diffwiththeideahere, andit's gonnabeoptionoptionbuttonsbecausethey'reallofourdifferentoptionoptionbuttons.
They'regonnabestoredinhere, andthisisgoingtohave a classaswell, whichisjustgoingtobebuttonedgridbecausewe'regonnahave a gridofbuttonsdownhere, Asyoucanseeandinsideofhere, we'regonnahaveallofourdifferentoptions, whichisjustbuttonswith a classhereofbutton.
Sowehavethatcardsystem, wegooverourstyles, andtheveryfirstthingwewanttodoissomethingthat I doineverysingleoneofmyprojects, whichisjustsaid a borderboxproperlysowecanjustcomeinhere.
Soit's likethatandthecontainerhereisjustgoingtohave a withwe'regoingtosetthatto 800 pixels, get 100 pixels, andwe'realsogonnaset a maxwithWe'rejustgoingtobe 80%.
Sowecanjustsaythatthat's goingtobeequaltodocumentthatgetelementby i d oftext, whichwesetinsteadofherindextoeEachteamouthereandthenextthingiswewanttheoptionsbuttoncontainer.
Sowhat's justdotheexactsamething?
Constantoptionbuttons.
Thisisjustgoingtobeequaltohere.
Documentthatgetelementsby i d ofoptionbuttonson.
Let's makesurewecallthisoptionbuttonselement.
Soweknowthatthisisanactualelementinherapplication, andnowourapplicationisgoingtohave a fewdifferentsteps.
Thefirstthingis, we'regonnahave a functionforstartingthegame, Sowe'regonnasay, Startgame, startgame.
First, getourtextnote, whichisgoingtobeequaltotextnotesdotfindandit's goingtotakein a textnoteforeachoneinthearrayandwewanttofindtheonethathasthecurrent I D.
Sowe'regonnasaytextmodot i d isgoingtobeequaltotextnoteindexJustlikethat.
Sowe'regonnacreate a buttonwhichisjustgoingtobeequaltodocumentDockeryElementcreateelementandwewanttomakesurewecreatehere a buttonandthenwiththatbutton, wewant a firststep a textofit, whichisgoingtobeequaltoouroption.
Sowe'rejustgonnasaytradetheydofor a swordjustlikethat, Andthisisgoingtoactuallyrequireustohavegooinorderforthisoptiontoshowup.
Sowe'regonnaneedtobeabletocheckrequiredstate, we'regonnasayrequiredstateThisisactuallygoingtotake a function, andthisfunctionisgoingtopassinthecurrentstatethatwehave.
Sowhenwejustpastethatinhereandessentiallyallthisinsaneisthatafterweleavethemerchant, weseeboththetownand a castle, anditgivesusoptionsbasedonwhatwewanttodoforallofthesedifferentthings.