I wanttobecreatedtheproject, and I'm callingitspaceinreaderbecauseit's thegamethatwillbecreatingonProbablyhavealreadyplayedthisgamewhenyouwere a child, butthemainideaisthatthere's a shipatthebottom.
I'm goingtohittheenemiesthatareunderdogbyshooting a bullet, andeverytimeyouhittheenemy, yourpointincreasesandtheenemyslowlycomedown.
We'regonnaget a valueofftrueoninsidethisbyLupita, insteadofjusthavinginvitedtruetomakeitaninfiniteloop, gets a phone, callitrunning, andwhenwewanttobreakoutsideofthisinfiniteloop, you'rejustgonnaturnthevariableoffrunningintofalseonitswillautomaticallybreakthisbyLou.
Sothisisaninfiniteloop, whichmakessurethatthegameit's runningalwaysandthewindowdoesn't closedownon, youknow, wewanttodosomethinglikemove a bulletormove a playorsomethinglikethatmoviehumanbeinginside a window.
I justmeanthegamewindowthatweareworkingonforthisprogram.
Itmeansthisscreenverybeensoanyways.
Sonowwehave a bridge, itlessgiven a shortleftclickonplay.
Andasyoucanseenow, it's incolor.
Looksgood.
Wehavechangedthetitle.
Wehavechangedthelogoandourscreenisupdatingred.
I don't likered.
I justwantedtoshowyouguysthatyoucanchangethecolorandmaybewe'llchange.
Dosomething a littlebitmorefunkyinthelatervideostrain.
I'm justgonnagowithBlack, that 000 andthat's prettymuchit.
Soguysareseeingthenextvideowherewearegoingtobefinallyaddingimagesonourplayerthatthere's maybe a spaceship, somekindinsideourgamewindowonDhe.
So I'llseeyouovertherewherewe'regoingtolearnhowblackimagesinsideourgamesoSothelastvideowelearnedhowtoadd a captionon a logoonhowtochangethebackgroundscreenoffourgamewindow.
Butbeforeweevenstartthat, I justwanttodiscussWhatisthis?
806 100 I havehere.
I wantedtodiscussthis, butthis 800 istheweightonthe 600 istheheight.
I think I mighthavesaidsomethingwrongaboutthisinthestartingvideos.
Uh, thiseternityisactuallythewitandnottheheight.
Andthe 600 istheheight.
Soifyoulookatourwindow, thisisthe X axis.
Youcanthinkoffthiswindowasan X and Y axiswindow.
Soifyougofromlefttoright, thisisan X axis.
Andifyoucouldgofromtoptobottom, thisis a wideaccess.
Soit's alwaysstartsfromzerocommazero, whichisatthetopleftcorner, andthenweaswegoontherighthandside, the X valuestartstoincreaseononthistoprightgoingon.
Andifyouwanttogointointothemiddle, it's approximately 300 notapproximatelyexactly 300.
So I'm tellingyouthisbecausewewanttoplaceourimagein a particularposition.
Sothat's whyweneedtogiveititsthatcoordinates.
Obviously, youcanexperimentwithgardeners a littlebit, butwe'llgointoit.
Soletmedecide a cometoverheresothatweknowthatwe'retalkingabouttheplayerandthenweneedtoaddtheplayerimageregistryeasy, likewehavedoneitinthedumpsofthelocalreligiouscopyandpastethisoverhereonchangetheUFOtoplay a doctor, p and G.
Andthenwe'regoingtogiveitthe X and Y accesswherewewanttheimage.
TobyCoalition.
Let's createtwomoreverybirth.
Let's calldisplayanexon.
We'regonnagiveitthevalueoff.
3 70 on.
I'm goingtogointowhywegivethesevaluestoPlayer X simplyaway.
Sofirstweloadedtheimageinthisplay, animageavailable, hepointedout, the X and Y valuesandthe X and Y valuesweredependentonthescreensizethatwegiveoverhere.
So, guys, thisisprettymuchitforthisvideomightberepeating a lotofthings a lotoftimesthatmyreallittlebitirritatingforsomeguys, buthopefullyyouguysunderstooditproperlyinthenextweek.
We'regoingtolearnhowtomovethis.
Soblowfromleftinside, rightinside, usingourarrowkeyson a keyboard.
That's goingtobereallyexciting.
Let's waitforthat.
So I seeinthenextvideothelastweek, welearnedhowtoaddanimageinsideourgamewindow, andthiswedo.
Andifweaddsomevalueifwemoveintheirdownwarddirection, soaddingandsubtractingvaluesfrom X and Y coordinatesoff a currentpositionofftheobjectorinthiscasepatient, canleadto a movementoffthatobjectonDDE, youhavetoadditto a byLoubecausewewantittohappencontinuously.
Soifyougobacktoourcourt, weneedtoaddonethingbefore I canshowyouguyshowwecanactvaluestoourplayer X andplayerby.
Arewehopingandsubtracted?
Sobeforethat, weneedtomakesomechangesbecausecurrentlythereisnowaytomanyouplayedthe X and Y coordinatesfromourwhilerunningblue.
Andifyoudidn't understandwhat I meantbythisoverhere, don't worryaboutit.
Whenweactuallythecourt, you'llunderstandwhatishappeningandwhat I meanbyincreasingthe X valuetomovetowardsthat I candirection.
And I'd Elsa's Thatimagehasn't beanraisedandthencreatedoverhere.
Itjustassumesthatimagehasmovedontherighthanddirectionifyou'readdingthefivevaluetoouralreadyexisting X coordinate, soanyways, weneedtodosomethingsothatwecanmanipulatethevalueoffClear X andClearwirefromtherunningbyLou.
Sowhatwecandoisgotothisdeathplayerfunctionandoverhereat X commawhy, sothatwecansendinthevaluesoffthenew X andbycordonsthatwewant, andtheninsulaplayer X andwearriveinjuston X andwhy, sothatthevaluesthatwesenttothisplayerinsteadoffthethelastvaluesthatitgotfromPlayer X andthey'rewhiteandsortofthatnewvaluesthatwesendinoff X and Y arebeingshownonthescreenorbeingdrawnonthescreen.
Buttheprogramjustseesthatthisexistsnowwhenwegodownoverherethanthisplayerthingiscalledon, ittakestheplayer X andplayerbyvaluefromhellonsendsittothisdeafplayerfunctionandinside X and Y.
Sonowlet's playedandyoucanseeit's movingtowardsthelefthand, saysimilarly, ifwedoinsteadofthe X coordinate, wedothe Y coordinateanddecreaseitsvalueisgonnagotousupconnections.
Soweneedtodo a coupleofthingsFirst, weneedtomakesurethatwecancontrolthismovementoffthespaceshipintheleftandtherightdirection, using a arrowkeysonthekeyboardonThesecondthingyouneedtodoisadd a boundarysothatthespaceshipdoesn't gobeyondourgamewiththeright.
Sowhatwe'llbedoingisthatmanyplacesleft a rookieon a keyboard.
Thespaceshipisgoingtomovetous.
Thelefthandside.
Andwhenyoupressedtherighthandside a rookie, thenourspaceshipisgoingtomoveontheresttonightandsaySowhatisthealgorithmtodothat?
So, firstofall, we'regoingtocheckwhetheranystrokeisbeingpressedonherkeyboardonafterwecheckthatwe'regonnacheckwiththecutestrokebreastiseitherlefthandside a rookieortherighthandsideIraqi.
Sowe'regonnadothat.
Soletmejustwritedown.
Andifcondition, letmejustremovethisoverhere.
Wedon't needit.
Soafterthat, letmejusttellyouonemorething.
Soanykeystrokethatispressedon a keyboardisactually, anditwenton, aswehavediscussedbefore, thateventisanythingthatishappening.
Insidergame, window, anykindofinputcontrol.
So, forexample, ifwemoveonMama's, weclickedsomewhere.
Weclosethiswindow, sothisis a greatevent, andsimilarly, wheneverwepressanykeystrokeonkeyboard, itis a keystroke.
Soafterpressingdownontheleft, a rookie, whenweremoveourfingerfromtheleft a rookiethatisknownastheremovalofthekeystrokeorthekeyupsocutedownispressingthatkeyorpressinganybuttononthekeyboard.