Butthere's a bitofah, largerscale, almostbusinessaspectofthegame, almost a tycoonaspectofthegamewherebyyoucanpurchasethesethingsinthestoreontherighthandside.
So I'm justgonnareadthechathere I ownonewassaying, Takethedayoff.
I enjoydoingthesedreams.
I wouldn't wanttotakethedayoff.
Tobehonest, I don't dotoomuch.
Rememberdays, actually, kindofJusttakeiteasyandand, um, reflectonhavinggrown a yearolder, I guess.
AndBabbittwassayingthathey, hadn't beenhereforquite a Well, actually, I doremember.
I don't think I sawyouinthelaststream, soyeah, ithasfeltlikeit's beenquite a while.
Sendforexes.
Hello, NanoMachineorHappyBirthday.
Thankyouverymuch.
Andre.
Singeverybirthday.
TrueGuineas.
Thankyousomuch, babytogas.
I'm lossesthan a machine.
I appreciateit.
AllisgoodthatsomegoodboatstalksayshonJJmu 999 Don't causethey'renot a machine.
Ertookhiseyemossandsomearegaming.
HappybirthdaySMRgaming.
InterestingIsthateyesthatthe, umthesoundlikethelike, thesensitivesoundorwhateverThatyouherewith a specialmicrophone?
I don't rememberoffhand, that's smrfromThinkofsomethingelse, buthello.
Later.
Happybirthday.
Thankyousomuch.
Um, smrgaming.
Oh, no.
Facebookcookies.
Methroughoutmyentirebrowser.
Usageeverywhere.
Yeah, that's true.
Thatusually.
Andthisis a jokethat I made.
And I thinkwhen I postedonTwitterwasthatusuallyinCS 50 wetalkaboutcookiesin a differentcontexttocooking, being a sortoflittlefilethatwebsitesgunstoreinyourbrowsertokeeptrackofsome, youknow, informationtopreserve a sessionorsomethingfor a website.
Andtherearefunteachingmoment, I think, forotherfolksandDutchgotit.
Oh, actually, I didgetyourmessagethatyouwerethefirstperson, actually, uhtospurtheHappybirthdaymessages.
Sothankyouverymuchfordoingthat.
I appreciateit.
BabaksayingInternetproblemsFibercablebroke a poppedonFridaychattowish, butitgotrepairedtodayafternoon.
Oh, that's rough.
I'm sorrytohearthatHope.
Hopefully, that's allsolidnow.
Andthefibercablewon't breakagainin a differentlocation.
But I can't imaginewhatitwouldbeliketolosemyInternetaccess.
I wouldfeellostandconfused.
So, cookieclicker, Let's goaheadandsetup a project.
Soifyourbrandnewtothestream, ifyou'veneverwatchedthestreambeforeontwitchorifyouneverwatchedtoseeits 50 straightmonth, which I'm sureyou'veprobablywatched a twitchstreamatsomepoint.
Butifyouhaven't watched a, um, CS 50 ontwitchvideo, typicallymyvideosonhere, ourgamedevelopmentofgameprojectsthatwedevelopfromscratch.
Typically, what I liketouseislovetodealthatwehaveusedtheunityaswellinthepast.
Buttheframeworkthat I likeforusingthat I likeusingforteachinggamedevelopment, particularlytothegamedevelopmentmostlyoutofnecessity.
Lovetodayisnot a threeframework, andthereforewecan't useitforthreedevelopment, buttheframeworkthat I enjoyusinghislovetodoyougotoloveto d dotorGEanddownloaditforyouroperatingsystemisexcellentlightweighttoTMdevelopmentframerthatusesLuaashisprogramminglanguage, which, ifyou'renotfamiliarwithLouLou, is a verysortofpopularandubiquitousprogramminglanguageusedinthecontextofgamesusedforgameenginesallacrossallacrosstheboard.
But, yeah, it's goodstuff.
I'm a bigfanofit.
I useitinmygameday, ofcourse, and I useitonstreamhere.
It's veryeasytoget a projectupandgoingquicklyandtoreiterateonit, itfeelslowlevel.
Itfeelslike, Excuseme, feelsyouhave a lotofcontrol, eventhoughthereis a lotofabstractionforyouandLouitselfas a languageisfairlysimpleandlightweightandveryflexible.
As a result, PoliceanniversaryOhsays, Let's put a barinforties, Thankyouverymuch.
I appreciate I don't howtosay.
I thinkit's a bigOtto, whichisPortugueseforthankyouinPortuguese.
Correctmeif I'm mistaken.
Um, thankyouallsomuchfortheverykindwords.
I appreciateit.
Soifyouhavelovetoneedinstalled, thenextstepisgoingtobeactuallycreating a projectfolderthatisgoingtoholdyourgamesfinals, yoursourcecodefilesandyourgraphicXandersounds, etcetera, Andtheversiontobeclear, Theversionofcookieclickerthatwe'regonnabemakingtodayisn't gonnabeasrobustascookitclickerbecauseweonlyhave a fewhours.
And, um, I liketouseyourcookiesascurrencytobuystufffromthestore.
Sowe'lltake a lookatallthatstuffandseewhatwecanaccomplishinjust a fewhours, becausehopefullywedon't wanttomakethistwoorthreepartsdreamlikesolitaryhaveenoughofthatgoingonalready.
So I'm gonnagotomyStreamsfolderhere, which I'vesetupforallofthestreamsyoudonesofar.
I'm gonnacreate a foldercalledCookieClicker.
AndthenthisisjustgonnabemyLou A folderandcanclickanddragitoverto V s codevisualstudiocode.
Ifyou'renotusing a texteditorofModernTexteditorlike V s CodeorAdamorsublimetext a highlyrecommended, youcantechnicallyprogramin a lotofdifferentenvironmentsthataren't normallyrecommended, likeMicrosoftWordorWordPadortextatit.
It's got a lotofgreatplugins, includingonethatletsyouactuallyrunyourlovetothegamesfromtheGScodeenvironmentitself, using a shortcutwhichissuperhandy, sohighlyrecommendGScode, butyoucanuseAdam.
Whatthatdoesisitjustsetsthetitlebarattheverytopoftheprogramandloved a trafficstopprintwilljustdrawsometexttomywhatwillbe a blackwindowthatweseeveryshortly.
If I command l onmyMac, whichistheshortcutforactuallyrunningifyou'reusingthe s codeIfusingthepixelbitestudioslovetodepluginwhich I recommend, thenyou'llseethatitdoesindeedsaycookieclickerintext.
It's allsortofsmallatthispointbecausejustatnativeresolution, I'm at 7 20 p.
Butitdoesindeedwork.
Wehave a verybeginningsortofbootstrappedtome.
Okay, Somuchof a game.
There's notmuchgoingon, but, uh, wherewehavegottenstarted, BlueBookersays, Haveyouevergotten a lovetothegameworkingontheweb?
Yes, actually, using a m scriptin, umlibrarycalledlove J s.
Ifyou're, forexample, developingsomethingthatyouknow, you'regonnahavetomaybemusegodotorUnityTootieorsomeotherframeworktocreate a gameintwo D andthenreleaseofficially.
It's a C plus, plusbinarythatjustusesLouisthatscriptinglayer, soit's prettyefficient.
I don't evennecessarilyknowififyou'regonnaprototype a fullgameandreleaseitsomewhereelse, I wouldsaymaybehalfthetime, youprobablydon't evenneedtoreleaseitinsomeotherframework.
Youprobablyjustreleaseditinloveto D.
ButseparatefromlovetodeLuisusedinindustry a lotforin C++ compiledgameenginesasthescriptinglayer.
Um, itwasusedformanyyearsuntilunitycamearoundbecauseunityandnowwaskindofwhat I think.
I don't knowwhatthenumberswouldbeoffhand, but I'm inclinedtosayby 40% atleastofstudiosnowraisingunityin a smallernumberusingunrealized.
Then a smallernumberareusinganinhousestack, andeveninunity, youcanstilluseLouisusingsomethingcalledMoonSharp.
Soit's possibletoscriptinluauwithunity.
ButUnityuses C sharpasitsscriptinglanguage, soit's a littlebitdifferentenvironmentum, butLouis a originallydesignedtobe a sortof a languagethatyouusethiopreventrecompilationofah, binary, essentiallyallowyoutointeractwiththeengineorourprogramandtojustrapidlychangethings I needtorecompile.
Atleastthatwasitsoriginalintendedusecasethatendsupmakingitverysuitableforgameswhererecompilationcanbeexpensive, especiallybackinthedaywhereitwasbig C plusplus C codebasesthatcouldtakemanyminutestorecompile.
Andsonowit's used a lotforlightweightengineslikethisisusedformodern c++ orseeorothergameengines.
Forexample.
Recently I sawitusedinthecontextofthegame.
Don't starttogether.
I believethatwaswritteninLuaareratherscripted, andLouishas a C plus.
Plus, I imagineBackEndStarBoundisanothergamethat I knowpersonallyusedlooasitsscriptinglayer.
Soit's allovertheplace.
You'llseeitallovertheplace.
Yes, Amarsays.
I wasjustsaying, I justfoundoutyougot a streamingontwitch.
I wasjustlookingabouthowintelligencemightbothhelpandconfusecompletely.
Newprogrammer.
SothanksSMRgamingfortuningin.
Appreciateit.
It's coolthatyou'reactuallytakingcourseshereonHarvardcampusandtuninginuntil a sensecanbe.
I thinkmaybe a beginningprogrammercanbekindoftricky.
Thenicethingaboutintel a Senseand V S Cody, that's nottoointrusive.
Uh, it's nice.
Ifyouhavetherightplugins, it'llactuallyhelpyououtquite a bit.
I knowthat, Forexample, I cansayfunctionlovedotandit'llactuallytellmeallofthename, spacesandstufflikethatthatarepresentinloveto D withoutmehavingtypedthembeforeuntil a sense, Ah, lotofthetime, we'lljustkindofreferredbacktothingsyoualreadytypedinyourprogrameffortofvariablesthatyou'vealreadyseen.
Butthenicethingabouthaving V s codeandhavingcertainextensionsinstalledisthatyoucanactuallyseejustbytypingsomethingyouknowtheargumentsthatgointo a function.
It's uptoyoutoactuallydefinewhatshouldgooninthefunctionandto, youknow, tellloveto D O when I press.
Uh, w I wantmycharactertomoveforward.
If I pressescape, I wanttoquitthegame, whichisactuallywhat I'm gonnadohere.
I'm gonnasayifkeyisequaltoescapeandonceagain, I stillhaven't updatedmyloveto t tobetherightarm.
I haven't updated V s codesincethelastupdatewhereitmessedupthelooautoformatting.
Soit's a bitof a problem, butwe'llgetbyit.
I'm actuallygettingusedtoitatthispoint.
Butifhe's abletoescape, but I wanttodois I wanttoquitthegameso I couldsaylove, donevent, notquit.
Andthennow, if I runthegameand I hitescape.
I don't havetopresscommandtoyouandhavetoclicktheRedCircleanymore.
I couldjusthitcommandcute, so I canjusthitescapeanditquitsthegame.
Soprettynicesavesme a littlebitofeffort.
I guessitadds a littlebittotheyou.
Whythisletsmesanitycheckthatinputisworkingsowecanactuallystartdoingotherinputs I willneedforthisgame, a functioncalledLovedupMousepressed, whichtakesan X o.
Have a leftcollect, have a rightclick a middleclicktheyhadmighthavesideclicksifyou'reusing a fancygamingmouse, so I careaboutwhetherweknowwhichbutton I clickonthemouse.
I wantwhether I wantedtobe a leftclickorrightclick.
I alsocareaboutwhetherthewherethe X and y positionofthemousearm I wanttochecktoseeif I'm inside a boxsomewhere I wanttosee, Forexample, whether I'm clickingonthecookie.
Sothiswillwewillactuallyusehereinjust a littlebit.
Umuh, yes.
Omarsays I lovehow 50 startswith C onLee.
You'llgetconfusedbyhighlevellanguageisthatway.
Then I waittoMitch.
Functionalityareimplementedinlowerlevellanguages.
Such a C learningSeefirstisabsolutelyperfectforobtaining a solid, fundamentalunderstandingofhowcomputerswork.
Ah, yeah, I think I wouldagree.
I thinkDavidwoulddefinitelyagreeto.
I thinkthat's Ah, hugepartofthecourseismotivationdefinitelysortoflaythisfoundationallayeruponwhichyoucanbuildtheknowledgeyouneedtounderstanddynamiclanguagesandjumpinwhereveryoufeellikeyouwanttoWhateverdomainyouwanttoexplore.
Um, I canseehowseealsocanbe a bitof a humpfor a lotofbeginnersbecauseofpointersandbecauseofmymemorymanagementand a lotofverysubtlebugsthatareeasiertohandleinlanguageslikeJavaor C P.
R.
OrPythonorJavascript.
A sortofmanagedmemoryforyouandgarbagecollection, butdefinitelyhavingthatlowerlevelunderstandingcanbeveryhelpfulandseeingpeopleobviouslyveryimportant, evenintheworldofdynamicprogramminglanguages, becauseyouneedtohaveyoursortofmoreefficientthingsbuiltinthoselanguageslikeLove, forexample, isbuiltin c++.
Butitallowsustointeractwiththefunctionalitywe'vedefinedusingLuissothatweprovide a goodprogrammingexperience.
Butwestillgetasmuchefficiencyasweneed.
Let's goaheadandthinkaboutwhatthefirstthingwewanttoseeis, andthatisprobably a cookie, mayberighthereinthecenter.
Soif I, uh, lookonline, I couldprobablyfind a nicebigimageof a cookie.
Sothatmightbewhat I wanttodio.
Anotherthingthat I wanttodoprobablyismakeitmorelowerresolution.
Butmaybewe'llworryaboutthat.
I don't knowthetime.
We'lljustsay I want a largercookie.
Importedintomygameare a largecookieimageimportedintomygamesothat I canclickonitandhaveyouknow, Cemsomethingmorethanjusttext, right?
Sowhat I liketodoisliketogotoopengameartdotorgandy.
I brieflylookedonhereearlierjusttoseeiftherewereanycookiesprites.
Therewasonewhatyoumightbeabletouse, andit's a littlebitoddjustbecausethisone, I can't tellifithas a backgroundornot.
It's notcompletelyflushwiththeedges, whichmightcause a slightissue.
But, um, wecancertainlyusethis.
I thinkso.
I'm actuallygonnatryitout.
It's opengameartslashcontentsuchcookieDashzero.
It's under a publicdomainlicense, soit's freetouse.
I don't thinkitmightbesomightneedactuallyeditthis, so I'm gonnabringitoverhopeinto a a sprite, whichismy, uh, sortofSpriteeditingprogram.
Anditisindeednotquiteflushwiththeedges, which, ifwewerejusttousethedimensionsofthespriteofthiscookieasbeingour, umwherewherewewanttocheckforthe X and y.
Youcouldimaginethatwecouldbringthecursorouthere, forexample, anditwouldstilltrigger a clickonthecookie, whichwedon't wantnecessarily.
Andwecouldall.
Wewillalsoget a littlebitofthisareaevenifwedouseitas a boxwhichwillcauseissueswithour X y.
Andwecouldprobablywrite a functionthatcheckstoseewhether a pointisinside a circle.
I'd havetogooglethattofindtheexactalgorithm, because I'm notsure, butwell, forsimplicityjustusedtheboundingboxofthecookie.
Butwe'lltightentheboundingbox.
We'reactuallygonnacropthiscookieimagesuchthatitisrightontheedgenowwhereitsedgelookslikeit's rightabouthereandhere, I think.
Yep.
Sothat's perfect.
Who's goaheadanddothat.
Bringitrighttotheedgethere.
Andnow I cangoupto I shouldbeabletogotoSpritecropandthensave.
What I'm goingtodois I'm goingtotakethiscookieSprite.
I'm actuallygonnaputitintherightlocation.
Sonowwehave a verytightcondensedcookiespring.
I'm gonnacopythisovertowhere I havemyRepoDevstreamscookieclicker, andwhat I'm gonnadois I'm gonnacreate a graphicsfolder, whichthisisconventionallyputitinyourproject.
You'regonnawant a fileforallofyoursource.
Goodfiles.
Youwant a projectforourfolderforyourgraphics, foryoursoundsandforyourlibraries, allkindsofthings.
I'm gonnagoahead.
Justdothis.
I'm gonnarenametolowercaseCookie.
Justbecausethecapitalletterkindofbothersme a littlebit, Um, I'm gonnaquit a spreadbecause I don't needitanymore.
Sonowwehaveanimagethatwecouldjustdrawinourscene.
Soif I goovertobacktomymaindotluaandlet's say I wanttosaycookietextureisequaltolovedotgraphicsdotnewimage, andthenwe'llsaygraphicsslashcookiedot p and G.
Now I have a graphicsimage, a newimagethat I candrawsomewhereinmyinmyprogram, right?
Andif I runit, youdoindeedseethat I havethiscookieinthemiddleofmyscreen.
Nowit's a littlelargeActually, I don't knowif I wantedtobequitethatlarge, soactuallygoingtodo, Andthisismorepreferabletohow I personallyliketodothings.
I'm gonnaloadupthiscookieagaininto a sprite, and I'm gonnajustshrinkthespritesizeddownbytwois 4 78 I'm gonnamakeitwouldmakeitto 40 right?
It's gonnait's gonnafilterit.
I'm goingtosaveit.
Andnow, if I goaheadand I dothisagain, youdoindeedseethatwehave a smallercookietexturethatwillbe, I think, a littlebitmoreappropriate.
Wedon't wanttobequiteasmassive.
And I alsowanttochangetheresolutionofthewindowtogetitskindofsquareatthispoint.
Andthat's notwhatyouusuallyaregonnadryyourgameat.
Butwe'remakingourwaythere.
OnBabakKnightsays X squaredplus y squaredlessthanradiussquared.
It's a greateditor, butas a newprogramordefinitelystickwith 10 s.
First I triedtodoMacosyouBantuandWindowsinparallelandfailedmiserably.
Soyoudoget a verysimilarexperienceattheterminalatthecommand, promptusingthingslike l s andCatandusingcommandlinktexteditorsandandwhatnotifyoudecidetodothat, andthecompilationprocessisgenerallyconsistent.
UsingWindowsisdifferentbecausealloftheshortcutsarechanged, andthereare a lotofidiosyncrasieswithWindows.
Yeah, Um, I don't knowif I agreewiththatwhipstreak.
I thinkit's importanttounderstand.
See, becausevery, veryclosetothehardwareofyourmachineumseeisjustkindof a lightlayerontopofassembly, whichitselfis a lightlayerontopofyourCPUisinstructionsetandunderstandinghow a CPUworks.
UnderstandinghowSeeanassemblywork, I thinkareprettyvaluable.
Youdon't necessarilyneedtoknowhowitworks, I think, todomoderndevelopment.
But I thinkhavingthatejcertainlyputsyouatanadvantage.
Um, couldyounotuseanoverlayor a stencilofsomesortofhitboxfor a bitmoreaccuracy?
Zzzz M Kloppenburg?
Uh, I'm notentirelysurethatlovetodesupportstheideaofjustinclickitplugginginan X y two a stencilonhavingthatrecord a collisionvalue.
I guessyoucoulddoitinsomesortofwaylikethat, but I thinkthat's a bitoverengineered.
Atthispoint, I wouldprobablyusethedistanceformula, the X squaredplus X wide, lessthanradiussquaredandusethat.
I thinkthat's probablybetterandeasierandprobablyfasterthanhonestlythanusing a stencil.
WeusedstencilsintheGamescoursefor a graphicaleffect.
WhenwehadwhenwehaddoorwaysintheLegendofZelda P set, weendedupneedingtouse a stencilsothatyoucouldwalkinbetweendifferentroomsdifferentandthenwalkthrough a doorwayandhavepartofthatbevisibleandpartofitbeinvisiblestenciling.
I usuallythinkofthatkindofcontext, butyeah, I guessyoucouldthinkofyoucouldalsousestencilinlikethis a stencilbufferandthatsortofwayandcheckforoneandzeroandwhatnot.
We'reimportingourcookietexture, whichisbasicallyjust a cookieimage I grabbedonlinestartingourgraphicsfolder.
Um, I have a loadfunctionjustasthetitleaquihandlerforescape, whichjustsaysifitpressescape, quitthegameonandtheywerejustdrawinglovedemographicsnotdrawthatcookietexturewhichjustdrawsitbydefaultat 00 thetopleftcornerstilldon't, like, seesomanysemicolons.
Yeah, I don't likethesyntax.
I think I don't likedevelopingtoomuchandsee, but I thinkunderstandinghowitworksisasvaluable.
Um, notDavis.
Youarenot a visionsayswhy, Lou, I'm notreallyintothis.
Justcurious.
Um, Lewisis a prettypopularscriptinglanguageingamedevelopment.
It's alsoverylightweight.
It's fast, especiallyamongstthedynamiclanguages, andwe'reusingitinthecontextofloveto D, whichis a verynicelightweight, lowlevel, itfeeling, butstillverypowerfulandfastto D gamedevelopmentframework, whichmakesitveryeasytoprototypegamesbecause I have a lotofcontrol, buteverythingisveryaccessible.
Streamsaysnot a visioncompletedinthisfaraswewillhavecookiesthatwecan't clickandcookiesgeneratingovertime, We'renotgoing.
Thio, um, implementtheentiretyofthecookieclickergamethatyouseeintheWebbrowserbecauseit's a verylargeprojectwith a lotofpolish, Um, whereweonlyhavethreehours.
Butwe'regonnagetusfaraswecaninthatdirection.
Andbytheendofthestream, I suspectthatwillhave a fairlycompletedgameoratleast a fairlycompletedprototypefor a game.
He's almostcertainlyright.
He's oneofthereasonswhyCaesar, yousogreat.
I'm goingtolearnmoreaboutwhathejusttalked.
Henowsays.
SMRgaming.
I appreciatethat.
Thanksforthethanksforthekindwords.
Ifanybodyhasanyquestions, goaheadandletmeknow.
AdamFighter, Arewegoingtoadd a crunchsoundeffect?
Weabsolutelycould.
Wecoulddefinitelydothat.
Adamasks.
Didyoufinishsolitaire?
Notyet.
That's stillongoing.
We'retaking a breakawayfromthatjusttocoverthisgameandto, youknow, sortof a changeofscenery.
Andnowit's just a littlebitofpadding, whichisnice.
Canyoushowwhatextensionsyou'reusingfor a viewofyour V s code?
AsksNipsis.
So I don't use a wholelotofextensions.
Buttheonethat I amusingforforloveto D iscalledlovetothesupportbypixelbitestudios.
Andif I gooverhere, youcanseethat I doindeedhavelovetothesupportbypixelbitestudios.
It's prettyeasytosearchforin V s code.
It's got 16,000 downloadsveryhighlyreviewed.
Allyoucansee, it's tributefive, roughlyfivestars.
Thisallowsyouifyou'reon a Mactojustpresscommand.
L assumingthatyouhaveloveinstalledinyourapplicationsfolderyousaycommand l Andthiswillsortofjustpulluploveforyouwithoutyouneedingtoclickanddragto a folderorneedAliaslovingyourterminalandthenrunitlike I usuallydoSupernice.