Oratleastitcertainlyfeelslikewhen I wasbackatworkatNewYorkUniversityin a roomthathadnowindowslivestreaminganddoingcoachcodingtutorial.
Somuchhaschanged.
I have a smileonmyface, but I know a lotofpeoplearestrugglingonhave a lotofdifferentkindsofhardshipsandchallenges, and I hopethatdoing a littlelivestreamthismorningcan I'm beingtappedontheleg.
Yes.
I wassayingmeaningfulimportantthingstothecamera.
Youcandoscratch.
That's whatwe'redoing.
I'm a veryseriouspersonwhodoesveryserious, meaningful, importantlastyear.
Anyway, what I wanttosayis I hopethatthislivestreamcanbringyou a distraction, a littlebitofhappiness.
Maybeyouwilllearnsomething I shouldsayfromtheoutsetthatifwhatyouwereexpectingtodaywas a propercodingtutorialaneducationalexperience, Notthatthateveractuallyhappensonthecodingtrain.
Itreallydoesn't.
Buttodaywillbeevenlessso.
I'm justgonnahave a littlefun.
Testoutthenewsetupthat I havehereathome.
I'vegotOperatorone.
Sayhellointhechatoperator.
Oneoperator, 1 11 yearsold.
E isoperatingthechattypebeinghellointhereandoperatornumbertowavetome.
Hello?
Operatornumbertwois, umlet's take a lookatthis.
Whatyougotonyourscreen?
They'reoperatingnumbertwo.
No.
What?
Likeyou'reright.
Youhavescratchopen.
Yeah.
Okay.
Uh, thisisOh, thereitis.
OperatorsnumbertoscratchProjecteightyearsold.
Sowewillbelookingatoperatornumbertwo's ups.
That's thewrongbutton, whichisfine.
I'm gonnatalkaboutthisin a second.
WewillbelookingatOperatornumbertwo's a scratchprojectin a littlebit.
I Allright, So I'm notworried.
Youknow, I'veneverorganizedwiththisstuff, but I shouldhavereleased, hadmyself a littleoutlineor a littlescript, which I donot.
Butthisistheplanfortoday.
First, I wanttotalkaboutthat.
Thislivestreamis a fundraiser.
Itis a fundraiserforthecoatingthatcuffstartcoatingCovein 19 SolitaryResponseFundforwhothisisfundraiserisbeingoperatedoutofGoogleandYouTubeitself.
Thereshouldbe a donatebuttonthatyoucanseethelivestreampagethatyou'relookingat.
So I knowthereare a lotofgoodcausesandorganizations, andthere's a lotofpeopleandorganizationsinneedrightnow.
Theis, sincethisissortofofficiallyvettedthroughYouTubeandthey'reactually I shouldknowthis.
But I believeGoogleismatching a certainnumberofcertain.
I thinkevery $2 forevery $1 youdonatetonecobialookeditupinadvance.
Butthereis a matchbyGoogleandYouTubeagain.
Thisisnotanofficial.
Thisisjustme.
AthomeinBrooklyn, NewYorklivestreamingwasequipmentthat I threwtogether.
So I'm notanofficialrepresentativeofthisfundraiserofwhoofGoogleofYouTube.
Anyofthat.
I'm justparticipatingas a citizenoftheworld.
Um, okay, soandkeepitfriendlyinthechat.
ThisisThisisthecodedtrainforkids, Okay?
I mean, I alwaystrytobe a familyfriendlyshow, buthereweare.
Hello?
Allright.
Doyouwanttoannouncethe Q and A.
Soletmefirstmentionthatthereis a codingtraindiscord.
So I'm justgonnapressmylittlebuttonhere, whichshouldpost a linktothediscordinthechat.
Ifyou'reIfyouwanttoengagedwiththecodingtraincommunityinvariouswaysjoinedthediscord I willbedoing.
I'vegotsomenewtechnologywhere I couldtakecallsand I'm gonnadolike a Q and a livecallinkindof, like, showlikethingwithpeopleinthediscordatsomepointnextweek.
I don't knowwhenyet.
Sojointhediscord.
Ifyouwantanannouncementforthat.
Um, let's see, uh, whatelsedo I wanttotalkabout?
Sothatwaas I'm talkingaboutthisas a fundraiser.
Whatam I forgettingAnything, operatorOneoroperatenumbertwo.
You'rejustworkingthereoverunscratched.
Operatornumbertwo.
Notevenpayingattention.
Uh, soletmetalkaboutscratchfor a second.
I amgoingtoswitchovertohere.
Um, youknow, weshouldfindoneofthecats.
Well, imIPs.
Okay, Operatornumberoneisofftofind a cat's.
Youguysdon't havetowhisper.
I'm veryconfused, bytheway, what's appropriateintermsofhavingkidson a livestream?
Soonethingthat I wanttosay I would I'm gonnareturntoLetmeletmefindthisplaylistherejusttogiveyoupeople a littlebitofupdateaboutwhat's goingonintermsofthecoatingtrain.
I apologizetoeveryoneintheworldrightnowthat I haveoffendedwithmycountingfromone.
Wehave a bigannouncementtomake.
I presenttoyou, operatornumber.
I knowthat I presenttoyouTheoBerrycomputer.
Notgood.
Okay, we'regonnaCanwelookatitsoon?
No.
Okay.
Allright.
What I wantedtoupdateyouonismyprogresswiththenatureofcodeplaylist.
Thisiswasmybeforetheworldchangedsoradically.
Thiswaswhat I wasworkingon.
Sothisis I wouldn't sayadvancedlevel.
Butthisissortoflike a followupplaylist, too.
Fortutorialsabouthowtoprogramin p fivegs.
Actually, what I shouldfindyouisthisone.
Letmegotoyou.
Soforthoseofyouwhomightbenewtothecodingtrain, usuallythestuffthat I programmedinisineitherJavausing a programmingenvironmentcalledprocessing, which I couldgoonandonabout.
But I'm goingtostopmyselffromdoingthatrightnow, or P fivegs, whichis a Javascriptlibrary.
Andifyougotolearning, I havetogotobig.
Ifyou'renewandyougotobeginners, youcanfindthetwoplaylistshereforifyouneverprogrammedbeforeAndi, I wouldsay, probablyespeciallyforallthekidsathome.
Thisplaylist, I wouldsay, isprobablyappropriateformaybesixgradeon.
Butif p five, But I wouldsaythattheprerequisitesarereallybeingsortofcomfortabletypingsuitkindofallyouneed, butthatsoifyou'veneverprogrammedinjobsbefore, thisis a playlistthatyoucanthatyoucanfollow, thenisthatthestate?
That's thesamecat.
Okay.
Uhhuh.
Thenwehave a wholelotofotherso I wanttomentionthisbecause a couplepeoplehaveaskedmeOh, I wanttodosomecodingwhile I'm athome.
Um, soBut I putthis a littlebitonpauseThese I wasrecordingin a studio I hadsetup N y u toschool, thearts, downtownBrooklyn, where I alsoteachclassesat a programcalled T P.
And I am a onguy.
But I'm gonnaseeif I cangetthisstudioworkingwellandgetcomfortablewithit.
So I couldcontinuethis.
Siri's, umButinthemeantime, todayisreallyjust a testrun.
A wayofsayinghelloandhopefullyprovidingsomecomfortorsupporttopeopleif I can.
Andthen, uh, what I willwhatwe'regonnadonowis I'veactuallysoletmetalkaboutscratchforus.
Umand I wonderif I canseethezoommeetinghereNow I can't, um, ondsothesolution, itseems I wouldassumeisthatrightnowthecodesayswhenthisspriteisbythewayoverhere, becausethisisreallywhere I couldseewhenthespriteisclicked.
Oh, you'regonnabroadcast a messageandthentheotherspritescanhearthemessagebroadcastmessageinhotOh, KenzointhechatIsKenzointhechatisgivingthesamesuggestionthatoperatornumberzeroisactuallyimplementingrightnowwherethere's I didn't notice.
Soapparentlythere's a wayinscratchwhereyoucanbroadcast a message.
YougobackThio, seewheretheircodingthiswhereyoucanbroadcast a message.
Boy, I'm really, uhAndthen I supposeotherspritescanhearthatmessageandthenah, hidethemselves.
Socanyoupulluptheprojectonthemainlaptop?
Oh, that's a goodidea.
Soif I goto, um, if I gototheproject U r l onmylaptop, I don't knowifit's shared.
Um, I'm doingthatrightnow.
Projectsslash.
Thisis a reallygoodwayofdoingit.
379 uh, 971380 Doesthatwork?
Hoopsarescratched.
Serveristhisiswhat I got.
Ourscratchserverisscratchingitshead.
Uh, sosofar, I thinkmaybethateither I gotthenumberwrongfor 379 Canyoureadthatnumbertome?
So I actually, um I'm saying, like, I don't know, scratch, but I doknowit a littlebit.
A long, longtimeago, I helped a littlebitinscratchonthescratchprojectitself.
Um, and I think I don't knowiftheystillhavethisfeaturethat I implemented.
I mean, I'm sureit's notmyimplementationanymore, becausethiswasalmost 20 yearsago, but, um, 15 yearsago, I guesstherewas, like, a waytodo, like, a twirlyimageprocessingfilter.
Haveyouseenthatanywhere?
No.
Looks, maybe.
Yeah, thatwholebookhas a 1,000,000 randomnumbersinit.
Wouldyouliketoshowit a littlebitunderthecameraoverthere?
Anyone?
What I thoughtwouldwewoulddowasthat I wasgoingtomake a scratchprojectmyself.
Um, mystuff.
And I thoughtwecouldmake a thankyoucard a scratch.
Thankyou.
Cardforessentialworkersandfirstresponders.
Soifwhatyouwantedtodowasdrawsomelike a thankyouordrawsomethingsthere, wecouldwecouldbringthoseintostretch.
Allright, so I'm gonnaattempttolearn a littlescratchwithmyhelpershere.
So I'lltake a snapshotofthat, um, andaddedintoscratch.
Yeah.
No, no, I'm waiting.
So I'm lookingatmylookingatmyphone, whichisalwayswhatyoushouldbedoingwhenyou'relivestreaming.
I think I mightneedsomewater.
Hey, anyoperatorswanttogetme a cupofwater?
Yeah, Let's see.
I'm gonnaletyouguysdrawfor a littlebit.
Areyouactuallygettingme a cupofwater?
Makesitokay.
Kidswillnotdothisif I'm notlivestreaming.
So I think, Oh, ticktacktoeandscratch.
Thatwouldbefun.
Butsooneofthethingsyouknow, I don't wantto I don't wanttooversellthemeaningfulnessofthis, but I thinkit's a nicegesturethatwecandotwothings.
Oneofthingsthat I thinkaboutwhen I hadtakemylittlequicktripstothegrocerystoreortakemyquickwalkaroundtheblocktoget a littlebitoffreshairis I seethatsanitationworkersairoutrestaurantdeliverypeopleareout.
Upsisout a llthehealthcareworkersairout.
Whatisthat?
Whyisitallcloudy?
Maybeyoushouldletitrun a littlelonger.
I'veneverknow.
Seeingthesupport, I thinkitjusthas, Like a There's probablyoneofthechatwillexplainthesciencebehind.
Why?
MywaterfromourNewYorkCityTapwater, whichisexcellent, is a littlebitcloudy.
Um, but, um, so, um, I I thoughtthatwecouldmake a littlethankyoutoallthosehealthcareessentialworkersthatonfirstrespondersthatareout.
So?
So, Holdon.
I think I haveanidea.
Wait, Stop, Stop, Stop!
Pause.
Yourdrawing.
Pause.
Yourdrawing.
Isit a thingandscratch.
Pause!
Pause, Pause.
Pause.
Tryingalready.
Stop.
Quick, QuickstopsatPaul's.
Okay?
Isit?
Ifit's a thingrightwhereyoucanhavetwodifferentbackdrops.
Areyoulisteningtome?
Soif I took a snapshotofwhatyou'redrawingnow, stopdrawing.
Stopdrawing.
Listen, if I take a snapshotofitnow, then I couldmakethat a backdropthatyoucouldadd a lotofthings.
I'lltakeanothersnapshot, andthenwe'llwe'llhave a break.
Isthat a goodidea?
No.
Oh, so I shouldjustletyoukeepdrawing, okay?
Nevermindpeople.
Soonething I let's seeif I couldfigureoutwhat I needtoget a sprite.
Sohowdo I evenimport a file?
Sohowdo I getHowdo I gettheimagefromthatcameraontothislaptop?
Oh, I know.
I'lltake a picturewithmyphone.
Okay.
holdon.
I know, but I justThisisn't gonnabethefinalphoto.
It's justuptotake a pictureofitsothat I couldlearnhowtobringitintoscratch.
Butthen I'lltake a newpicturewhenit's finished.
Yougotme?
No.
Allright.
Okay.
I'm doingit.
Okay, soletmeairdropthis.
Let's seeifthatworks.
Yep.
Okay.
Soif I have a photothat I tookindownloads, whichisrighthere, umand I weretoLet's justcropthismuchoutofit.
Andnow, if I savethis, I assumehowdo I bringup a photointoscratch?
Yougoinsomeway.
Okay.
Didyougetbored?
Helostoperatornumberzero, bytheway.
Um, okay, sowhat?
Heneeds a break.
Wearen't good.
Yeah.
Take a break.
Um, choose a sprite, uploadsprite?
Oristhatisthiskindofspritebe a backdroporthatsomethingdifferent?
No.
Soif I wantedtobethebackground, then I wanttomakethoselittlehearts a umLet's gotocostumes.
Okay, soit's kindoflike a backgroundin p five, souploadbackdrop.
Solet's dothat.
That's I gotit.
Thisis a backdrop, andwe'retocallthisThankyouwon.
Sonowwhen I gotocodeand I couldjust, uhdo, umwhenthere's a thingthattheprogramstartswhenyoucleanwhenyouclickthegreenflag.
Right.
Sowhereinwhich, um, where's thatevents?
Okay, I'm beingtoldbreakingnews, breakingnews.
I'm beingtoldthatturnedthenotificationsoff.
Watchhere.
I'm beingtoldthat I confinedineventswhenflagclicked.
Soputthathere.
Andthenwheredo I switchthebackdrop?
Looksokay.
Switchbackdroptwo.
Thankyou.
Want.
Okay.
Sonowwhenever I click, I willgetthattoMichael.
Now, am I notinthecodefor a spriterightnow?
Sooneofthethingsthat I thinkisdifferentaboutworkingandscratchthemfeelinglike P fiveisthatbasicallyeachelementcanhaveitsowncodeassociatedwithit, andthisisquitesimilar.
Sowhat I doinJavascriptwithobjectorientedprogrammingwillmake a classthat's a templateformakingobjects.
Andthenlet's setthevariabletoCan I getthewidthoftheCan I getthewithofthecanvasin?
Um, like I'm beingtold, I don't needvariablesbecausetheSpriteitselfprobablyhas a position, soAllright, somaybe I don't needthesevariablesbecausethere's somethingcalled, likemotion.
Maybe.
Howdo I movesomethingmotion.
Move.
Goto X o set X twoglide.
No.
So, youknow, ifyouheardthat, butgotomakesitjustdisappearandgothereandlied.
Makesitglidethere.
Allright, soOh, there's gotorandomposition.
I don't wanttomakefireworks.
Let's seeifwecanmakethisbeachball, um, belike a littlefireworkthatrisesupinbursts.
Um, solet's haveitglide.
Okay.
Great.
Sowhenso I shouldgotowhenthethinghehasclicked.
Whatiscalledthegreenflag.
Motionglide.
Uh, wow.
So I don't I don't havetomoveitonmyown I couldsayglideforfivesecondstoWell, first I wanttosetit.
Solet's have a goto, um, thebottomofthecanvasso I canactuallyseewhereitisrightnow.
Overhere.
Oh, that's interesting.
Ittellsmewhereitis.
Howdo I knowthesizeofthestage?
Isthere a waynooneinthechat?
Oh, first.
Well, thankyou.
I don't likeThankyoutoo.
WantValenzuelawhodonatedCanadiantotomake a donationfortonight.
Thankyou.
Um, so, uh, I wanttoglidetolikeSo I wanttheex.
I wanttheextobezeroandthe y two b negative.
Like, howdo I knowtheheightofthestage?
Well, somebodytellmethesizeofthecanvasofJulianLopezissayingthesizeofthecampusesNegativeto 42 to 40 height, negative.
1 80 to 1 80 Solet's gotonegative 1 80 There's a waytosee.
Okay, so I wanttobroadcastthismessageburst, andthen I needtomakeanotherspray, whichis a star.
Candeservesomekindof, likestarPerfect.
Let's makeitthisstar.
Andsowhenitreceives a messagewhenitreceives a messageburstSofirst, whenit's clicked, I wanttohideit, whichmustbeunderLukeLookssohideitwhen I seeyouSee, thereceived a message.
Burstshow.
Sothisisgoingup, andthereappearsnowItshouldalsosetitslocationtoSo I dowant a variablebecause I wanttheactually, no, I couldPricesaiditslocationtowheretheotherspriteslocationis.
Sowhen I whenitreceivesburst, setthatwheremotioniswhere I saiditslocationgoto I don't wanttogoto a randomposition.
Nobeachball.
I lookatthat.
Okay, sothismovesup, andthenitappears a goodokay, soduplicateineventsduplicateinevents.
So I wanttomakelotsofstars.
Howdo I dothat?
Maybe I'm beingtoldinthechatthat I duplicateinadvanceinevents.
Wherearemyendevents?
So I'm lookingherelookingforduplicateincostumes.
They'restupid.
Kate.
Youcreate a cloneoff.
Yeah, but I wanttoduplicate.
I'm duplicatingthatstartedplayingStarr.
Yes, itdoes.
Yeah, Well, thengotostar's costumes, huh?
Um, fromgettingmadefromthemouse.
ButyouOh, but I don't wanttoduplicatethedesign I wanttomake, actually, multiplesprites, eachwiththeirownbehavior.
Butmaybe I dowanttomakedifferentcostumeseventually, becausethenitcouldchangetheirhavedifferentcolors.
Noway.
No, that's costumes.
Yeah.
Okay, okay, okay.
Clone.
Everyone's talking.
TheCzechloanisright.
Create a cloneofmyself.
Now, can I do a loop?
Sowhere's theloop?
Doyouknowwhat a loopis?
UmOh, May I?
It's called a repeatinstretched.
Youknowwhatrepeatdoes, butwhatdoes?
Repeat d'oh!
I know, butwhatdoesthatmeantorepeat?
Maybepeopledon't knowwhatthatmeans.
I knowwhatitmeans.
I'm askingyou, explainit.
Pete. 00:58:28.7
check.
Subtitles and vocabulary
Click the word to look it upClick the word to find further inforamtion about it