LetmejustdoubleclickonitandopenitinusualstudiobecausewearegonnausevisualstudioforthisAndhere I'm gonnakeepitintheduckor a knkeepitfromtheduck.
Solet's gooverhere.
Whatdoweneedinourplayerscript?
Whatisthatthingthatweneed?
Well, wealwayseat a coupleofaerialvariables, butbeforedeath, letmejustactingclassand a littlebitdownandmovethislike, thisyear, andthere's goingtobethere's notgonnabeprocess, butit's gonnabephysicsprocess.
We'regonnahave a physicsprocessandhereabovewe'regonnainheritfromKinomanicbody.
Socinematicbodyto D insteadofthenode, We'regoingtohave a privatevectortwo, whichisgoingtobeourmovement, and I'm goingtocallthatwonbydefaultVectortozero.
Next, we'regonnahave a privatefloat, whichisgoingtobeourremoveunderscorespeedBydefault, I'm goingtoseeits 400.
Soifyoutake a lookatyourthefirstbackground, sobothoftheseareatzeroforthe X Now, forthewhythisoneisatnegative 727 aboveoneandeverybackgroundthat's aboveyou.
See, wehavetwoofthesearetheonethat's up.
It's atwhypositionnegative 720 onLeeExpositionwouldchangeandtheexpositionwillchangefor 1000 or 12 80.
So 1280.
So, forexample, wehavebackaround 10 Ifwewanttoaddthenextonetoit, thenitwillbeat X 12 80 thenthenextoneisanex 12 80 multipliesbytwothanbythree.
Soifwe'removingtotherightsideelseifwe'removingtotheleftsideBecauseifwearemovingtotheright, I needtogobackhereinchemistrythatforyounoticewheretheplayerisfacing.
Heiscurrentlylookingtotherightside.
If I selecttheanimation, whichisouranimatedspritesandgooverhereintheinspectorinfrontofpropertiesYousee, here I havesomethingcalledflipagentflip V.
Hey, ageisforhorizontallyisforvertical.
If I checkthisonforages, he's gonnaflipitandhe's goingtostartlookingtotheleftside, asyoucansee.
Andjusttobe 100% surethat I addedthejumpson a mapHereitis.
Sowehavethejumpisspace.
Soyeah, everythingwasclearButit's notworking.
Why?
Well, becauseyouseehereMovingslideWeneedtotellAndif I hoveroveryousee, I don't knowifyoucanseetheexplanationyouseeherewehavemovementslidewhichtakes a Vectratrulynearvelocity.
Butitalsotakes a vectortofloornormal.
Whatdoesthatmean?
Weneedtotellit.
Whereisthefloor?
WeknowthatgoingdownsoinGodotenginewhenwegodown.
Andif I dighere, MyhighlighttoolshighlightGoingdownandcomeon.
Highlight.
Sothisisthecoordinatesystem.
Thisisthe Y Axis, thisisthe X axis.
Plusisoverhere.
Negativesoverhereforthe X butforthewine, negativeisup.
Ifyouwanttolearnmotorbikedough, I havethatyoumightgetDevelopmentAcademy.
Hopefullybynow.
I hope I havealsoBlenderinandGameMakerand I'm workingonMonrealIf I don't havenoreallyclickonthelinkbelow, and I probablyhave a monthtrial.
So I haveonemonthtrialfor $2.
Youcantrytheacademyoutfor $2.
Clickonthelinkbelowandyoucanlearnforonemonthfor $2 like, Yeah, soyeah, I willseeyouguysinanotherWaascrackingpeoplebackoutagainwith R two d platformergame.
Andthepositionforitisgoingtobe 640 by 360 becausehalfoffthewidthandtheheightofourscreenshouldweakenpositionatthecenter.
Buteventhoughwehavethecamera, if I commandmetorunourgame, we'restillgonnagooutofthescreen, Asyoucanseealready.
Sohowcanwemakethecamerafollowtheplayer?
Firstofall, what I'm gonnadois I'm goingtoclickonthecameraandwe'regonnacreate a script.
Soletmejustgooverherethescriptsandrightclickandgreet a new C charmsscriptthat I'm goingtocallthatonecamera, followsomethingsgohere, cameracamerafollow.
Solet's gooverhereandintheenemy's forthespritesWehavethezombiegreenselectalltheseimagessoalltheimagesandputthemoverhereSoif I zoomonourzombieandclickheretoplay, youwillseenowthezombiesplaying.
But I'm as 12 framestothatheplays a bitfasterbecause I believe 12 framesisokay.
Yeah, 12 framesisokay.
Youcanpumpitupifyoubelieveit's notokay.
So, yeah, that's uptoyou.
I'm gonnaselectthegreenzombiegameobjectandgohere.
Addknowthat I'm at a collisionshapedutynowforthecollisionshapetodo, weneedtoselecthere a shapesoit's goingtobe a rectangularone, and I'm goingtosimplymovethisoverhereinthemiddleandresizeit.
Someonewith a littlebitmoreinthemiddleofsomethinglikethisandthezombiesanimationisconfusingme, Sonny.
Uncheckitsothatitdoesn't play.
Andnow I cansimplyresizethisdudeAndwhilewearegoodtogoSothisisgoingtobeourgreenson.
Thisiseverythingweneedtodoforhim.
If I gooverhereinourscenes, I'm goingtoduplicatethegreenzombieand I'm goingtocallthisoneRed.
Soyou'regoingtohave a Redd's onbeingtoduplicatethegreenzombieagain, and I'm goingtocallthisoneghost.
Soselecthere, theredzombieindoubleclickhere.
And I'm goingtochangethisonetoreadZombieandselectingheretheanimationforthespringtime.
Wedislikedalltheseframesoractuallysimplygoingtodeleteallofthisandcreate a newanimationforthewalkandgosimplyhereinsideoffourfolderandselectalltheanimationsfortheRedZombieandsimplyputthemhere.