Gamecreators Beginners Guide To Game Maker Programming pdf

 0  0  41  2019-03-09 23:38:15 Laporkan dokumen yang dilanggar
Beginners Guide to Game Maker Programming Be g in n e r ’s Gu id e t o Ga m e M a k e r 4 .0 Pr o g r a m m in g This is a t ut orial in how t o st art pr ogram m ing using Gam e Maker 4.0. I t is m eant for beginners wit h lit t le or no knowledge about com put er program m ing languages. Docum ent w rit t en by Carl Gust afsson (carl.gust afsson@hom e.se) Gam e Mak er 4.0 by Mark Overm ars This docum ent is also available in online HTML for m at at :ht t p: www.gam ecr eat ors.nl, t hanks t o Mart ij n. Docum ent dat e: 2002- 03- 05 1 Beginners Guide to Game Maker Programming 1 Contents 1 CONTENTS .2 2 INTRODUCTION .3 2.1 2.2 2.3 2.4 2.5 3 SOME SPRITES.4 CREATE OBJECTS .5 ROOM FOR IMPROVEMENT .5 SAVE, SAVE, SAVE! 6 ACTION .6 REFINING THE ACTIONS .7 FIRST VARIABLE .8 FIRST FUNCTION .9 MORE VARIABLES .10 FIRST SCRIPT .11 GETTING RID OF THE EVENT 12 BULLET LOADING TIME .13 ENEMY AIRCRAFT.17 RANDOMIZING.19 OUCH! THAT HURT!.20 SHOOTOUT .22 PYROTECHNICS .23 ENHANCING THE GAME .26 6.1 6.2 6.3 6.4 CENTERED SPRITES .26 SMOOTHER ENEMY APPEARANCE .27 GOING GLOBAL .28 WHERE’S MY ENERGY? 30 7 LIFE, THE UNIVERSE AND EVERYTHING.33 7.1 7.2 7.3 7.4 7.5 THE CODING BEGINS .8 4.1 4.2 4.3 4.4 4.5 4.6 5 6 CREATING A GAME .4 3.1 3.2 3.3 3.4 3.5 3.6 4 ACKNOWLEDGEMENTS .3 GAME MAKER INFORMATION .3 PURPOSE OF THIS DOCUMENT .3 OTHER REFERENCES .3 WELL?.3 5.1 5.2 5.3 5.4 5.5 8 A GALAXY FAR, FAR AWAY .33 COOL WORD: PARALLAX .34 ENEMY FIRE .35 MEANING OF LIFE .37 SCORING.39 FINAL WORDS .41 8.1 8.2 8.3 8.4 END OF THIS GUIDE.41 COMMUNICATION .41 USELESS STATISTICS .41 BYE .41 ENEMIES SIGHTED! 17 2 Beginners Guide to Game Maker Programming 2 Introduction 2.1 Acknowledgements I w ould like t o use t his space t o say a heart ily Thank You t o Mark Overm ars for creat ing such a w onderful gam e building t ool. Thank You Mar k! Thank you Mart ij n for convert ing t his guide t o HTML form at and publishing it at ht t p: www.gam ecreat ors.nl .Thank You also t o all m em bers of t he Gam e Maker com m unit y who ar e great at helping m e and each ot her wit h gam e building advice, help and hint s. Finally, I am grat eful for all com m ent s and suggest ions t hat I hav e received regarding t his docum ent fr om a num ber of Gam e Maker user s. 2.2 Game Maker information Gam e Mak er is writ t en by Mark Ov erm ars. I t is a com plet e gam e building t ool t hat can be used t o creat e 2- dim ensional com put er gam es t hat can run on Microsoft Windows sy st em s. The pr ogram can be downloaded fr om t he Gam e Maker w eb sit e, ht t p: www.cs.uu.nl/ people/ m ark ov/ gm ak er/ index.ht m l. The applicat ion includes an int egrat ed graphics cr eat ion t ool t hat can be used t o creat e sprit es, a drag- and- drop int erface, m aking it a built -in program m ing language t hat is sim ilar t o well- known program m ing languages like C/ C+ Pascal and BASI C. Wit h Gam e Mak er it is possible t o creat e com put er gam es wit hout using a single line of code, t hanks t o it s int uit ive drag- and- drop icons represent ing gam e ev ent s and act ions. How ev er, t o be able t o cr eat e m ore advanced gam es and really release t he full pot ent ial of Gam e Maker t he use of Gam e Maker Language (hereaft er referred t o as GML) is an absolut e requirem ent .2.3 Purpose of this document This guide was w rit t en as an at t em pt t o int roduce user s t hat ar e used t o cr eat e gam es using t he drag- and- drop m et hod, t o t he concept of GML. 2.4 Other references I am going t o m ak e a lot of r efer ences t o t he Gam e Maker PDF m anual (Gam e_Maker.pdf) so I suggest you have it ready. I t can be downloaded from t he Gam e Maker w eb sit e (see 2.2 Gam e Maker inform at ion) 2.5 Well? Well? What are you wait ing for? Read on! 3 Beginners Guide to Game Maker Programming 3 Creating a game We need som et hing t o wor k wit h in order t o be able t o under st and t he concept s of GML. This m eans t hat I ,in t he beginning, am going t o refer t o t he graphical drag- and- drop icons and com par e t hem t o t he GML code. So, st art up Gam e Mak er and cr eat e a blank gam e (File -New, but I am sure y ou know t hat )3.1 Some sprites I n order t o see anyt hing in our gam e w e are going t o need som e sprit es. I f you do not know w hat a sprit e is, I suggest you scan t hrough Chapt er 3 of t he Gam e Mak er Manual. Ther e are som e sprit es included wit h t he Gam e Maker inst allat ion, and t o m ak e t hings easier (t his is not an im age creat ion guide) I am going t o use t hem in t he gam e. For t he player sprit e, w e are going t o use t he im age called “SR71.bm p” I t can be found in t he “Sprit es \Transport ”folder of t he Gam e Mak er inst allat ion direct or y. The im age looks like t his: Ah, yes! The SR- 71 Blackbird is m y absolut e fav orit e plane! Add a new sprit e. I n t he nam e box ,w rit e “sprPlayer” I always use t he pr efix “spr” in t he nam es of m y sprit es, since if a sprit e has t he sam e nam e as an obj ect ,err ors m ay occur. So, I consider it a good habit t o have a nam ing convent ion for sprit es and such. Then, when t he obj ect is creat ed, you do not hav e t o w or ry about t he nam e coinciding wit h a sprit e nam e. Anot her good t hing about t his is t hat lat er, when you look at your code, for exam ple when debugging, you im m ediat ely know if you are r efer ring t o a sprit e or not wit h a variable nam e. For obj ect s, I suggest t he use of “obj ”as prefix. OK, so you hav e nam ed t he sprit e? Good. Now ,click t he “Load Sprit e” but t on. I n t he file select ion dialog t hat appears, browse t hrough t he Gam e Mak er inst all direct or y unt il you find t he “SR71.bm p” im age file. Select it .Make sure t hat t he checkbox m ark ed “Transparent ”is check ed (t hat is, t her e should be a t ick m ar k in it )Ot herwise, check it .This will m ake part s of t he sprit e t ransparent .Which part s? All pixels t hat have t he sam e color as t he pixel in t he lower left corner of t he sprit e will be t ranspar ent when t he sprit e is lat er drawn on t he scr een. Most gam es I know involve som e kind of shoot ing. For shoot ing we need bullet s. Creat e a new sprit e and call it “sprBullet ”For a bullet im age, let us use a red ball. Red balls are com m on in gam es. Load t he im age “ball2.gif” int o t he “sprBullet ”sprit e (The im age file is locat ed in “Sprit es \Breakout ”in t he Gam e Maker inst allat ion direct ory .Make sur e t he sprit e is t ranspar ent (see abov e) That is all sprit es we will need for now. 4 Beginners Guide to Game Maker Programming 3.2 Create Objects The sprit es w e hav e cr eat ed ar e j ust dum b im ages. OK I agr ee, t hey have som e int elligence, like t ransparency and bounding box inform at ion, but t hey really do not do anyt hing. The t hings in a Gam e Mak er gam e t hat act ually perform s som e act ions are t he Obj ect s. Did you read Chapt er 3 of t he Gam e Maker Manual? I f not ,please read it now, since it explains t he m eaning of obj ect s. Creat e a new obj ect and call it “obj Player” Now you see it was a good idea t o call t he Player sprit e “sprPlayer ”and not j ust “Player” I n t he “obj Player ”obj ect ’s sprit e select ion box, select “sprPlayer ”Now our “obj Player” obj ect will look like t he “spr Player” sprit e. Gr eat !Tim e t o cr eat e t he bullet obj ect .Creat e a new obj ect .Nam e it “obj Bullet ”and select t he sprit e “spr Bullet ”as t he sprit e for t he “obj Bullet ”obj ect .3.3 Room for improvement Now we need a place for t he obj ect s t o act .This is done in a r oom .Creat e a new r oom and call it “Room 1” OBS! no space charact ers) You m ay be t em pt ed t o call it “Room 1” wit h a space before t he “1” but t hen y ou would have a hard t im e referencing it from t he GML, so nev er use spaces in t he nam e for y our obj ect s, sprit es, room s, et c. I f y ou need t o separat e t wo words in t he nam e, use t he under scor e charact er inst ead “_” Click on t he “Background” but t on in “Room 1” t o view t he background set t ings. Make sure “Draw background color” is enabled and click on “background color” upper right corner of background set t ings) Select a nice gr een (like grass) color. Click “OK” t o close t he background set t ings window. Now y our room should be all green. The room size should be widt h: 640, height :480. I f not so, change it t o t hese values. The default Speed set t ing is 30, which is pret t y norm al for gam es. This m eans t hat a new gam e fram e will be cr eat ed 30 t im es each second. Hence t he expr ession “FPS” Fram es Per Second. Not t o be confused wit h “FPS” First Person Shoot er Sorr y, j ust being st upid. We ar e now going t o place an inst ance of our “obj Player” obj ect in t he room .I n t he Obj ect select ion box of t he r oom ,select “obj Player” Now click ONCE in m iddle of t he room .This should place an “obj Player” inst ance wher e you clicked. I f y ou happened t o click m ore t han once, or m ove t he m ouse t oo m uch when clicking t here m ight have been cr eat ed m ore t han one “obj Player” inst ance in t he room .To rem ov e t hem ,right -click on t hem .Mak e sure t here is only one “obj Player” inst ance in t he r oom .Here w e pause a m om ent t o cont em plat e on t he t erm s obj ect and inst ance. To explain t his, I am going t o use a m et aphor. Hope it w orks. Your obj ect is like a cookie- form ,y ou know t he ones you use when m aking ginger- br ead cookies. When placing your obj ect s in your r oom ,y ou ar e act ually placing “inst ances” of t he obj ect s, which is like st am ping out t he cookies using your cookie- form .Each inst ance will act j ust as described in t he obj ect ,but each inst ance will have it s own local variables, like x and y posit ion and speed (m or e on variables lat er )Just like each ginger- bread cookie y ou st am p out using your form is shaped like t he form ,but you can give t hem all different looks w it h som e icing. Hey! I am get t ing hungry! Back t o t he gam e. Click OK t o close t he room window. 5 Beginners Guide to Game Maker Programming 3.4 Save, save, save! Now we ar e alm ost ready t o st art t he gam e, j ust t o check t hat t he “obj Player” inst ance is displayed properly in t he gam e r oom .But before we run it ,SAVE I T! Rem em ber t o save your gam e oft en and ALWAYS save it before y ou run it .I t MAY happen, under cert ain circum st ances, t hat t he com put er freezes com plet ely and all you can do is t o rest art it .NOT FUN if your gam e is not saved. Right .Save it wit h an im aginat ive nam e (I called m ine “GMLTut orial” Now it is t im e t o st art it .Hit F5, or click on t he green arrow t o st art t he gam e. Okaay! Now w e have creat ed t he foundat ion for a Windows gam e. I f you do not see t he green background wit h an inst ance of “obj Player ”in t he m iddle, you hav e m issed som et hing earlier in t he t ut orial, or som et hing else is wrong. Check back t o see if y ou m issed anyt hing. Close t he gam e w indow t hrough pressing [ESC] or clicking on t he w indow’s “Close” icon (t he cross- m ark, y ou know) 3.5 Action I n order t o be able t o call our cr eat ion a gam e, we need t o be able t o int eract wit h it in som e way ,and preferably som et hing should be m oving t oo. We will st art out by m aking it possible t o m ove t he “obj Player” wit h t he cursor key s of t he keyboard. Back in Gam e Mak er, double- click on t he “obj Player” obj ect t o open it .Now we are going t o creat e som e act ions. When som et hing happens t o an obj ect ,it is called an “ev ent ”The obj ect ’s r esponse t o t his ev ent is called an “act ion” What w e want is t hat when we press any of t he cursor k eys, t he “obj Player” should st art m oving in t hat direct ion. Ther e is an ev ent but t on in t he “obj Player” obj ect t hat says “No k ey >This but t on hides a long list of different key ev ent s. Click on t he sm all select ion icon on t he right hand of t he “No k ey> but t on. This will display a large list ,wit h som e under- list s cont aining all keys of t he keyboard. Select t he “Left >key in t his list .The but t on should now display “Left >Now w e can define t he act ions t hat should t ake place when t he left cursor k ey is pressed on t he keyboard. The list of act ions is t o t he right of t he obj ect window. Find an act ion t hat is called “St art m oving in a direct ion” I t is t he t op left act ion, represent ed by 8 red ar row s point ing away from t he m iddle. Drag t his icon ont o t he whit e space bet ween t he ev ent list and t he act ion list .We can call t his t he “Act ion sequence” A window will pop up when you drop t he act ion in t he act ion sequence. I n t his w indow you can specify t he param et ers t hat are needed t o define t he act ion. Click on t he left arr ow t o select it in “Direct ions” and set t he speed t o “5” Then click “OK” What we now hav e done is t o define t hat when t he left key is pr essed on t he keyboard, t he “obj Player” will st art m oving left .Now, select t he “Right >k ey in t he k ey ev ent but t on. Add t he “St art m oving in a direct ion” act ion t o t hat event ,set t he Right direct ion, and set t he speed t o 5. Repeat t his for t he k eys “Up> and “Down> set t ing t heir corr esponding direct ion in t he “Direct ions” sect ion of t he “St art m oving in a direct ion” act ion. Save t he gam e and st ar t it again. 6 Beginners Guide to Game Maker Programming You should now be able t o m ove t he plane using t he cursor keys. Not e howev er, t hat it is not possible t o st op t he plane. Neit her can y ou m ov e diagonally. 3.6 Refining the actions We will now refine t he act ions a bit ,as well as add a “Shoot ”act ion. Open t he obj ect window for “obj Player” Select t he “No key> ev ent .This ev ent will happen when all keys on t he keyboar d are r eleased. Add a “St art m oving in a direct ion” act ion and select t he square in t he m iddle of “Direct ions” Click OK. This should m ake t he “obj Player” st op when no k ey is pressed. To add a shoot ing act ion, we need t o decide w hich key should be used t o fire t he bullet .I usually choose t he [SPACE] k ey for t his. I n t he obj ect window for “obj Player” choose t he “Space> k ey event .I n t he act ion list ,select t he “Obj ect s” t ab t o display t he act ions t hat hav e som et hing t o do wit h obj ect s. Select t he “Cr eat e an inst ance of an obj ect ”look s like a light bulb) act ion. I n t he window t hat pops up, choose t he obj ect “obj Bullet ”and t ick t he checkbox m ark ed “Relat ive” This m eans t hat an inst ance of t he “obj Bullet ”obj ect will be cr eat ed at t he sam e coordinat es as t he inst ance of t he “obj Player” obj ect .Click OK. Now a Bullet will be cr eat ed. But it needs t o be m oving t oo, t o be of any use. To do t his, open t he obj ect window for t he “obj Bullet ”Select t he “Cr eat e” ev ent .Add t he act ion: Set direct ion and speed of m ot ion” This act ion can be found in t he “Mov e” t ab, and looks like 8 blue arrows. I n t he popup window for t he act ion, ent er “90” as t he direct ion and “15” as t he speed. This will m ake t he bullet st art m oving in t he direct ion “90” wit h speed “15” Direct ions are m easured in degrees and w ork like t his: 90 180 0 270 So, 90 would be st raight up. One m ore t hing needs t o be done before st art ing t he gam e. What happens t o t he bullet t hat reaches t he t op of t he scr een? Not hing. I t j ust cont inues on “forever” So, when enough bullet s ar e fired, t he com put er’s m em ory w ill be filled up wit h dat a about bullet s t hat m oves up, up, up, and w e never see t hem .The t hing t o do is t o m ak e sure t he bullet is dest roy ed once it reaches t he t op of t he screen. Select t he ev ent “Out side” This will happen when an inst ance m ov es out side t he scr een. Add t he act ion “Dest roy t he inst ance” fr om t he “obj ect s” t ab of t he act ions. The default values ar e OK. Now t he bullet will be dest roy ed once it reaches out side t he screen. Save and st art t he gam e and t ry m oving, st opping and shoot ing. 7 Beginners Guide to Game Maker Programming 4 The coding begins Alright .I f you have follow ed t he direct ions above, you should have a sm all gam e wit h a plane t hat m ov es and shoot s. The reason I creat ed t his is j ust t hat now t hat you have done som e dragging- and- dropping, w e can relat e t he code st at em ent s t o t hese act ions t o im prov e t he underst anding. At least ,t hat is a t heory I hav e ☺Coding. That m ay sound spooky t o som e people, while ot her s will relat e it t o very “cool st uff” Really, coding is like doing t he t hing we did before, wit h t he icons and such, but wit h t ext inst ead. Act ually it is possible t o creat e a gam e builder wher e a gam e cr eat or is able t o do ev er yt hing wit h icons and dr agand- drop t hat is possible wit h coding in Gam e Maker, but t hat w ould m ean hundreds of different icons, and t he list of icons in an act ion sequence w ould be longer t han t he screen, and it would be im possible t o gain a good ov erview. Wow, Word com plained about a long sent ence So, t his is act ually a sit uat ion where a pict ure does NOT say m ore t han a t housand words. 4.1 First variable The first t hing we did wit h t he drag- and- drop act ions was m aking t he plane m ov e when t he cursor k eys are pressed. We are now going t o ex change t he act ion icons for code. Open t he “obj Player” obj ect and select t he “Left >k ey ev ent .Rem ove t he “St art m oving in a direct ion” act ion from t he act ion sequence list by select ing it and pressing [DEL] Now, view t he “Code” t ab in t he act ions list .The t wo act ions I use t he m ost her e are “Ex ecut e a script ”and “Execut e a piece of code” Drag t he act ion “Ex ecut e a piece of code” t o t he act ion sequence. What now pops up is som et hing t hat looks like an em pt y window –a CODE window This is where we ent er t he code t hat should be ex ecut ed as a response t o t he “Left >k ey event .Ent er t he follow ing code: direction =180; speed =5; What t his m eans is t hat t he variable direct ion of t he curr ent inst ance of t he “obj Player” obj ect is set t o 180, and t he speed is set t o 5. This is called variable assignm ent .To r ead m or e about variables and assignm ent s, see sect ion 23.2 and 23.3 of t he Gam e Mak er Manual. Essent ially a variable is a place in t he com put er m em ory t hat can hold a value. There ar e different kinds of values t hat a variable can hold. Gam e Maker differs bet w een t wo different t ypes of variable inform at ion: num ber s and st rings. A num ber is j ust a plain num ber, like 1 5 2.21 63.132 24 8 Beginners Guide to Game Maker Programming St rings are list s of char act ers t hat are enclosed in single- quot es or doublequot es, like: Hello” This is a st ring” This is anot her st ring’ The use of bot h single- quot es and double- quot es for defining a st ring is one of t he “nice” aspect s of Gam e Maker. I t m ak es it possible t o easily include a single- quot e or a double- quot e in a st ring. Think about it .I f you only could define a st ring w it h double- quot es, how w ould you t ell t he com put er t hat you want ed a st ring t hat CONTAI NED a double- quot e? This code: aLittleString =And she said “gasp” and fainted”;will be very confusing for t he com put er. I t w ould be t reat ed as TWO st rings, wit h t he word “gasp” bet ween t hem .The sam e goes for single- quot es. I nst ead, t his code could be used (not e t he difference) aLittleString =And she said “gasp” and fainted’;Back t o t he gam e. The variables “direct ion” and “speed” are built -in variables, and ev ery inst ance has t hem .When we are w rit ing variables like t his, we are r efer ring t o t he so- called local variables t hat belong t o an inst ance of an obj ect .This m eans t hat if we would check t he value of “direct ion” in, for exam ple an inst ance of t he “obj Bullet ”obj ect ,w e w ould not see t he value 5, but inst ead anot her value, t hat is local t o t he “obj Bullet ”inst ance. By set t ing t he variable “direct ion” t o 180, w e t ell Gam e Mak er t hat t he direct ion in which t his inst ance should m ov e is 180 (left )Set t ing t he “speed” variable t o 5 inst ruct s Gam e Maker t o m ov e t he inst ance 5 pixels each fram e, in t he direct ion of t he “direct ion” variable. Fair enough? So, why is t her e a sem icolon (at t he end of each st ring? This t ells t he program int erpret er t hat t his is t he end of t he st at em ent .Each st at em ent should end wit h a sem icolon. Work s about t he sam e as “dot )for people. Dot s m ark t he end of a sent ence. A st at em ent in a com put er pr ogram is about t he sam e as a sent ence t o people. Act ually, t he GML does not need t he sem icolon. I t underst ands t he code anyway, if each st at em ent is placed on a separat e line, but it is considered “good program m ing” t o use sem icolons. OK, now w e are done wit h t he ev ent .Click t he gr een check m ar k t o st or e t he code changes and close t he window. Ot herwise, t his window blocks all ot her windows. I t m ust be closed when y ou are r eady edit ing. 4.2 First function Let us go t o t he ev ent .Rem ove t he “St art m oving in a direct ion” act ion fr om t he key ev ent .Add a “Execut e a piece of code” act ion inst ead. Now, w e could do t his in t he sam e way as t he event ,by set t ing t he “direct ion” and “speed” variables, but j ust t o learn ot her ways t o do t he sam e t hing, we do som et hing different .We are going t o use a funct ion. A funct ion is like a collect ion of program st at em ent s t hat are bundled t oget her and can be ex ecut ed by calling t he funct ion nam e. 9 Beginners Guide to Game Maker Programming When y our m at h t eacher speak s of funct ions, he m eans som et hing like t his: y( x) 4 +3x This is a definit ion of a funct ion. The nam e of t he funct ion is “y” The “x ”in t he parent heses is called an argum ent t o t he funct ion “y” The result of, for exam ple, y( 5) would be 19. 4 +3 *5) The “ast erisk) charact er is com m only used as m ult iplicat ion operat or in com put er languages. What w e have done here, if it had been a com put er program ,w ould be t o call t he funct ion “y” wit h t he argum ent “5” A funct ion is called, t akes som e argum ent s, does som e com put ing, and ret urns a value. Not all funct ions ret urn values, and not all funct ions t ake any argum ent s at all, but t his is t he general idea of a funct ion. Not e: in ot her languages t he concept “funct ion” could be called ot her t hings, like procedure, m et hod, subrout ine et c, but pract ically speaking t hey w ork t he sam e. So, if y ou look in t he Gam e Maker Manual, on page 76, t her e is a definit ion of a funct ion called “m ot ion_set ”The definit ion looks like t his: motion_set(dir, speed) The t ext aft er t he definit ion in t he m anual explains t hat t his funct ion w ill set t he speed of an obj ect t o t he “speed” argum ent ,and t he direct ion t o t he “dir” argum ent .OK, so now ,let us use t his funct ion in t he key ev ent .Do y ou st ill have t he code window (em pt y) for t he act ion in t he key ev ent ?Good. Ot herwise, double- click it t o open it up again. I n t he em pt y code window, writ e: motion_set(0, 5);Now we have called t he funct ion “m ot ion_set ”w it h t he argum ent s “0” and “5” in t he places wher e “dir ”and “speed” should be defined. And v oilà! When t he cursor k ey is pressed in t he gam e, y our inst ance should now st art m oving in t he direct ion 0 (right )wit h speed 5. We hav e now done t he sam e t hing, but in t wo different ways. Which way is t he best depends on t he sit uat ion. I n t his case, I t hink t he second way ,wit h t he funct ion call is t he best ,but suppose t hat y ou j ust w ant ed t o change t he speed of t he inst ance, and not t he direct ion. I f so, it w ould be easier t o j ust assign a new speed value t o t he “speed” variable. Lat er in t his guide, we will define and use our own script s, w hich w ork s in a sim ilar m anner as t he built -in funct ions. 4.3 More variables Ther e is a t hird way t o accom plish what we have done in t he and k ey ev ent s. Select t he “Up> key ev ent for t he “obj Player ”obj ect .Add an “Execut e a piece of code” act ion t o t he act ion sequence. I n t he code window, writ e: hspeed =0; vspeed =5; Now, what was t hat ?hspeed” and “vspeed” ar e t w o ot her exam ples of variables t hat are built -in in an obj ect .These variables define t he horizont al and vert ical speed of t he obj ect .I f you ar e a m at hem at ician, you could say t hat “hspeed” and “v speed” defines t he speed v ect or in rect angular 10 Beginners Guide to Game Maker Programming coordinat es, while “direct ion” and “speed” defines t he speed v ect or in circular coordinat es. Anyway, set t ing t he ver t ical speed “vspeed” t o –5 m eans t hat t he inst ance should st art m oving upwards. That is because t he y axis on a com put er scr een is point ing dow nw ards, so t he furt her dow n t he screen you go, t he higher t he value of t he y coordinat e. So, in order t o m ake an inst ance m ov e upw ards, w e m ust have a negat ive vert ical speed. The horizont al speed is set t o 0, m eaning t hat t he inst ance should not m ov e left or right at all. The only m ovem ent left is t he k ey. We are going t o creat e it in a fourt h way. Close t he code window for t he key. 4.4 First script This t im e you ar e going t o learn how a fr eest anding script works. Creat e a new script (Menu: Add -Script )This will bring fort h a code window, m uch like t he ones we have used befor e. The difference is t hat t his w indow has a nam e box on it s t op. Ent er t he nam e “Mov ePlayerDown” t here. The nam e could be anyt hing, but should describe t he script ’s funct ionalit y in a good way .Rem em ber, do not use spaces in t he nam e. Ent er t he following code in t he script :hspeed =0; vspeed =5; Then y ou can, if you want ,close t he script ,but you m ight as well leave it open. Go back t o t he “obj Player” obj ect window. Select t he key ev ent .Rem ove t he exist ing act ion from t he act ion sequence. Add an “Ex ecut e a script ”act ion. A new w indow w ill pop up, w her e you can select w hich script should be run, and ent er som e argum ent s t o it .To t he right of t he “Script :t ext box t her e is a select ion icon. Click it .A list of script s should appear. Only one script exist s in t he list so far, t he “Mov ePlayerDown” script .Select it .Our script does not use any argum ent s, so leav e t he rest of t he window as it is and click OK. Now, when t he player presses t he key ,t he “obj Player ”inst ance will call t he “Mov ePlayerDown” script ,which in t urn will st art t he “obj Player” m oving downwards. What is t he point of m aking a freest anding script ?Well, in t his case, t her e is not m uch of a point ,but if t he script would be very long, it is easier t o m aint ain if it is freest anding. You do not need t o open t he obj ect and search for t he corr ect event t o find and edit t he script .I t is also possible t o hav e m any fr eest anding script s open at t he sam e t im e. That is not possible wit h script s t hat belong t o an obj ect ev ent .The m ost im port ant reason t o m ak e a fr eest anding script is t hat any obj ect m ay use it .I f an inst ance of t he obj ect “obj Bullet ”needed t o m ove downwards wit h speed 5, it could also call on t his new script ,and t he script would act on t he “obj Bullet ”inst ance inst ead of on an “obj Player” inst ance. I t is also possible t o call a freest anding script fr om anot her script .11 Beginners Guide to Game Maker Programming Alm ost forgot about t he ev ent .That is where t he plane is st opped. Close t he code window, and select t he ev ent .Rem ov e t he “St art m oving in a direct ion” act ion and add an “Ex ecut e a piece of code” act ion inst ead. Writ e t he following in t he new code window: speed =0; The direct ion does not m at t er when t he speed is 0, right ?Dat ’s it !We hav e now ex changed t he graphical drag- and- drop icons for t he code t ext .I t did not require m uch coding, did it ?But t here are lot s of t hings t o im prov e wit h coding, so we are going t o cont inue on t his gam e a bit m ore. Save your gam e and t ry it .You should not not ice any difference. The code works in t he sam e w ay as t he icons did. 4.5 Getting rid of the event Act ually, t he ev ent is no good for st opping a player- cont rolled inst ance. You m ight have not iced t hat if you ar e shoot ing w hile m oving, and release t he m ove k ey, but hold t he shoot key, y ou st ill m ove. This is because since you ar e holding dow n t he shoot key (SPACE) you are not get t ing any ev ent .And y ou can im agine how m any event s we would receive in a t wo- player gam e. No, not m any .How can we solve t his? This is t he way I w ould solve it .Open t he “obj Player” obj ect and select t he event .Rem ov e all act ions fr om t his ev ent (should j ust be one here, but anyw ays) Select t he k ey event ,and double- click on t he “Execut e a piece of code” act ion in t he act ion sequence. This should bring up your code window. I nst ead of set t ing a speed and a direct ion for t he “obj Player” here, w e could j ust change t he coordinat es for it ourselves. I n t hat case it would ONLY m ov e while t he key is pressed. Anot her t hing we will gain wit h t his is t hat we will be able t o m ov e diagonally as w ell. Great !So, delet e all code in t he code window, and w rit e t his inst ead: x =x –5; This m eans t hat w e set t he variable x t o it self m inus 5, t hat is, we decrease it s value by 5. The x variable of an inst ance cont ains it s x- coor dinat e in t he room .So, by decreasing t he x variable, t he inst ance will m ove 5 pixels t o t he left .This is repeat ed for each gam e fram e as long as t he player holds down t he key .That is exact ly what we w ant .We want t he sam e t hing wit h t he ot her direct ion key s, so let us change t he code for t he ot her k ey s t oo. 12 Beginners Guide to Game Maker Programming Open up t he event for t he key in t he “obj Player” obj ect .Double- click on t he act ion in t he act ion sequence t o open t he code window. Delet e t he “m ot ion set ”funct ion call and writ e t he following inst ead: x +5; This is t he sam e as w rit ing x =x +5; only t his is short er. Now I t hink you know w hat t o do wit h t he and k ey s. That is right .The code for t he k ey ev ent should cont ain: y -5; and t he code for t he k ey event should be: y +5; For t he key w e m ade a fr eest anding script .We could as well keep it and edit t hat inst ead of changing t he act ion int o an “Execut e a piece of code” act ion. So, j ust open t he script “MovePlayerDown” and change t he code as st at ed abov e. Now it is t im e t o sav e t he gam e and run it again. There are t w o t hings I want you t o not ice about t he gam e now. 1. The plane does not cont inue m oving when t he fire key is held down but t he m ov e keys ar e released. Good. 2. I t is possible t o m ov e t he plane diagonally. That is good t oo. 4.6 Bullet loading time When shoot ing bullet s from t he plane you m ay have not iced t hat t hey com e in a nev er- ending, unint errupt ed flow. We m a y w ant t his, but I do not t hink it looks v ery good. So, let us add som e loading t im e t o t he gun. To do t his, we will use t he alarm feat ure of t he “obj Player ”obj ect ,and a local variable. The t heor y behind t he loading t im e goes like t his: When t he k ey is pressed, before firing a bullet ,a local variable is checked t o see if t he gun is ready t o fir e. We can call t his variable “gunReady” The variable “gunReady ”will t ake on one of t w o values. Eit her it is “t rue” t hat m eans t hat t he gun can fire, or it is “false” which m eans t hat t he gun can not fire right now .I f “gunReady” is t rue w hen is pressed, a bullet is fired, and t he gunReady is set t o “false” This m eans t hat when is pressed again, t he gun will not fire. How ev er, at t he sam e t im e as we set “gunReady” t o false, we set an alarm t im er. When t he t im er runs out ,it is going t o set t he variable “gunReady” back t o “t rue” and we can shoot again. This will repeat it self during t he whole gam e. OK. The first t hing t o do is t o m ak e sure t hat t he variable “gunReady” has a value t he first t im e it is checked when pressing t he Fire but t on. This is called t o init ialize a variable. I f it is not set t o a value befor e it is check ed, t he gam e will be halt ed wit h an er ror. The “CREATE” event of an obj ect is a good place t o init ialize variables. Open t he obj ect window for t he “obj Player” obj ect and select t he CREATE ev ent .Add an “Ex ecut e a piece of code” act ion. I n t he code window t hat appears, writ e t his: gunReady =true; 13 Beginners Guide to Game Maker Programming That will set t he variable “gunReady ”t o “t rue” The w ord “t rue” is one of Gam e Mak er’s built -in const ant s. Pract ically speaking, using t he word “t rue” is t he sam e as using t he num ber “1” The word “false” is anot her of Gam e Maker’s built -in const ant s. I t represent s t he num ber “0” That m eans t hat we could as well writ e gunReady =1; and achieve t he sam e result .But using t he words “t rue” and “false” kind of m akes m ore sense. I will t ake t his t im e t o int roduce a new concept in coding; t he concept of com m ent s. Com m ent s are very im port ant in code. The com m ent s ar e m eant for t he hum an reader of t he code, and not for t he com put er ,which will sim ply ignore it .Use com m ent s a lot t o describe what you m ean wit h your code. This will m ake it a lot easier lat er when y ou want t o change som et hing. Or debug it .To add a com m ent ,writ e t he t w o charact ers “before t he com m ent .Like t his: Make the gun ready to fire. gunReady =true; The com put er will com plet ely ignore t he com m ent and ex ecut e t he ot her code. But when som eone sees t his code segm ent ,t hey will underst and m ore about what is happening t han if t hey only saw t he com put er code. A com m ent can also be added aft er a program st at em ent ,like t his: gunReady =true; Make the gun ready to fire. but I prefer t he st yle wit h t he com m ent on it s own row. You do what ev er you like. Now, rem em ber how w e shoot t he bullet ?I n t he k ey event of t he “obj Player” w e creat e an inst ance of t he bullet obj ect .Open t he k ey ev ent for t he “obj Player ”Delet e t he “Creat e an inst ance of an obj ect ”act ion from t he act ion sequence. Add an “Execut e a piece of code” act ion t o t he ev ent .This will, as usual, open up a code window. The first t hing we will do her e is t o check if t he gun is ready. That is, w e will check if t he variable “gunReady” is “t rue” How do w e “check” t he v alue of a v ariable? That is what t he “if” st at em ent is for. The definit ion of t he “if” st at em ent is like t his (excerpt fr om t he m anual) An if st at em ent has t he form if (expression>)statement> or if (expression>)statement> else The st at em ent can also be a block. The expr ession will be evaluat ed. I f t he (r ounded) value is <0 (fa lse )t he st at em ent after else is execut ed, ot herwise (t r u e )t he ot her st at em ent is execut ed. I t is a good habit t o always put cur ly br acket s ar ound t he st at em ent s in t he if st at em ent .So best use if (expression>)statement> else {st at em ent >14 Beginners Guide to Game Maker Programming Hm m m .That m ight be a bit hard t o under st and if you are not a program m er. To clear t hings out ,I will sim ply writ e out t he “if” st at em ent as it should look in our code window. Writ e down t his: if (gunReady =true) then {That was not so hard, w as it ?This m eans t hat if t he variable “gunReady ”has t he value “t rue” t he code t hat we (lat er) put inside t he “curly braces” will be ex ecut ed. Ot herwise, it will j ust be ignored. I have added t he word “t hen” aft er t he parent hesis, but t hat is not required. I t j ust adds t o t he readabilit y of t he code. You m ay use t he “t hen” w ord or not ,as you like. The so- called “curly braces” will be used a lot in t he code. They com e fr om t he C/ C+ language. The t hing is t hat if we j ust want t o per form one single code st at em ent inside t he “if” st at em ent ,t he braces are not needed, but it is consider ed good program m ing st yle t o always include t hem .The braces kind of cr eat e a “block ”of code t hat ,t o t he language int erpret er, look s like a single st at em ent .To underst and why t his is useful, consider t he following exam ple. I f t he variable “speed” is higher t han 5, w e want t o m ove t he obj ect t o t he posit ion where x =40 and y =80. Sim ple enough. So, we writ e: if (speed >5) then x =40; y =80; But THAT will NOT work as w e w ould expect it t o do. The “if” st at em ent only affect s t he FI RST st at em ent ,j ust below it .That m eans t hat if “speed” is NOT higher t han 5, t he “x =40” will be skipped, but t he “y =80” will be ex ecut ed anyway. To solve t his, we need eit her anot her “if” st at em ent for t he “y =80” st at em ent ,t hat is t he sam e as t he first “if” st at em ent ,or, m uch easier, we could use “curly braces” Like t his: if (speed >5) then {x =40; y =80; This m eans t hat bot h t he “x” t hing and t he “y” t hing are included in t he “if” st at em ent .Now, if “speed” is NOT higher t han 5, neit her “x =40” nor “y =80” will be ex ecut ed. I f “speed” how ever I S higher t han 5, bot h t he following st at em ent s will be execut ed. Now, do you underst and t he point in using “curly braces” They ar e used for m or e st at em ent s, but we will t ake t hem as we go. Now, back t o t he gam e code. I n your code window y ou should now hav e a com plet e “if” st at em ent wit h “curly braces” But t her e is st ill not hing inside t he braces. Here w e will cr eat e an inst ance of t he “obj Bullet ”obj ect .Earlier t his was done using a drag- and- drop act ion. Now we will do it in code. I t is quit e sim ple. We w ill use t he funct ion “inst ance_cr eat e” I t can be found in t he Gam e Maker m anual, in sect ion 25.2, page 79. I nside t he curly braces, ent er t his: instance_create(x, y, objBullet);Ther e! Now you have cr eat ed a bullet .But what about t he “x” and t he “y” Should we not ent er som e num erical value t here? Act ually t hat is what we have done. The variables “x ”and “y ”holds t he posit ion of t he curr ent “obj Player” inst ance (r em em ber, we ar e in t he “obj Player” obj ect while coding) and t hese coordinat es will do as t he st art ing coordinat es of t he “obj Bullet ”inst ance. This is t he sam e as cr eat ing an inst ance wit h t he dragand- drop icon and checking t he “Relat ive” checkbox. 15 Beginners Guide to Game Maker Programming Now, t hat was not all we should do, was it ?No. We also should set t he “gunReady” variable t o “false” t o m ake sure t hat t he gun can not be fired im m ediat ely again. Ent er t his, j ust aft er t he “inst ance_creat e” line: gunReady =false; That was easy! Now we will have t o set an alarm t o m ak e sure t hat t he “gunReady” variable becom es “t rue” again, aft er som e t im e. Set t ing an alarm is done like t his: alarm[0] 10; Ther e ar e 8 alarm c s2” and resize it t o 200 x 200 pixels, j ust like above. Paint it black and add som e st ars t o it .But t his t im e t he color of t he st ars should be light gray, and not com plet ely w hit e. You can add a few m ore st ars t o t his background. Five, m aybe. Then open t he room window again and click t he Background but t on. Select “Background 1” select t he background im age “bgSt ars2” for t hat back ground. Make sur e t he “Visible when r oom st art s” checkbox is checked. Give t he new background a “Vert .speed” of “2” Close t he window and t r y t he gam e. I t st ill looks like a flat st ar field. That is because w e hav e forgot t en t o m ake t he new st arfield t ransparent .OK. Open t he background “bgt St ars2” and check t he lit t le box called “Transparent ”Then save and t ry t he gam e again. Alright !Now t her e are t wo st ar fields m oving at different speeds, creat ing a sm all illusion of dept h. To m ake it even bet t er, we will add a t hird st arfield layer. Do j ust like t he second background, but call t his one “bgrSt ars3” and use a dark er gray color for t he st ars in it .You can add a bit m ore st ars t oo, m aybe 10 or so. Then check t he “Transparent ”checkbox and open up t he room .Add t he new st arfield background as "Background 2” and set t he “Vert .speed” t o 1. For t he t hird t im e, t est t he gam e. That looks quit e OK, does it not ?Wit h j ust a lit t le bit im aginat ion you will see a “deep” space m oving past beneat h t he plane. 34 Beginners Guide to Game Maker Programming 7.3 Enemy fire I t is now t im e t o m ak e t he enem ies shoot back at you. That will not be so difficult ,now t hat you k now a bit about GML. The plan is t hat wit h random int ervals, t he enem y planes should fire a bullet at you. Whenev er you are hit by a bullet ,your energy would decr ease by 10 unit s. First w e need a new bullet obj ect .We should not use t he one t hat is fired from t he player plane, even if we ar e going t o r euse it s sprit e. Creat e a new obj ect ,call it “obj Enem y1Bullet ”and select t he sprit e “spr Bullet ”for it .Now we need t he enem y plane t o shoot t his bullet at t he player. Creat e a new script for t his and call it “Enem y1Fire” The script should creat e a bullet inst ance and set t he alarm t im er of t he enem y so t hat anot her bullet can be cr eat ed. Writ e t his in t he script :instance_create(x, y, objEnemy1Bullet);That will creat e an inst ance of t he “obj Enem y1Bullet ”obj ect in t he sam e coordinat es as t he enem y plane is. But it is not going anywhere. We need t o give it a speed and aim it t owards t he player. Fort unat ely t her e is a Gam e Maker funct ion t hat m akes t his ver y easy .I t is called “m ov e_t owards_point ”and t hen you t ell t he funct ion t o which coordinat es t he inst ance should m ov e, and how fast .Now you t hink t hat it is as easy as t o j ust w rit e t he funct ion. But no, if we j ust wrot e t his funct ion, t he enem y plane would m ove t owards t he player, and not t he bullet .To do t hat w e need t o get t he I nst ance I D of t he creat ed bullet inst ance. So, change t he line you j ust w r ot e t o t his: myBullet =instance_create(x, y, objEnemy1Bullet);Now we have got t he inst ance I D of t he new bullet and can use it in a “wit h” st at em ent .Like t his: with (myBullet) move_towards_point(objPlayer.x, objPlayer.y, 5);That will st art t he bullet in t he direct ion where t he player is and wit h t he speed 5. Good. Tim e t o set t he alarm t o go off aft er som e t im e again, t o cr eat e anot her bullet .Add t his line t o t he code: alarm[0] 60 +random(60);That m ay seem a bit st range, but what w e hav e done here is t o add t he value 60 and a random value bet ween 0 and 59.99999. Thus t he t im e for t he next bullet t o be creat ed will be som ewhere bet w een 2 and 4 seconds (60 and 119.99999 fram es) Here I do not care so m uch about t he decim als and such, because w e will not be able t o not ice t hem in t he gam e. The code in t he script “Enem y1Fire” should now look like t his: myBullet =instance_create(x, y, objEnemy1Bullet);with (myBullet) move_towards_point(objPlayer.x, objPlayer.y, 5);alarm[0] 60 +random(60);What is left t o do now is t o add t he script t o t he “alarm 0” ev ent of t he obj ect “obj Enem y1” Do t hat now .You should know how by now .We also need t o m ake sure t hat t he script is run t he first t im e. This is done by set t ing t he alarm in t he script t hat is run at t he creat ion of t he enem y inst ance. That script is called “Enem y1I nit ”Open up t he script and add t he following line t o it :alarm[0] random(60);35 Beginners Guide to Game Maker Programming Here w e do not care t o add t he “60” in fr ont of t he random funct ion. I j ust did not feel like it .Do it if you want ,but t hen no enem y plane will fire unt il t hey have exist ed for 2 seconds. Now t hey fire t he first t im e bet w een 0 and 2 seconds aft er t heir cr eat ion. The bullet should, j ust like t he player ’s bullet s, disappear once it has m ov ed out side t he scr een. I n t he “obj Enem y1Bullet ”obj ect ,open t he “Out side” event and add a “Dest roy t he inst ance” fr om t he “Obj ect ”t ab of t he act ion panel. Accept t he default set t ings and click OK. Finally, t he bullet should do som e dam age t o t he player. Creat e a new script and call it “PlayerBullet 1Collision” Here we should dest roy t he bullet inst ance as w ell as lower t he energy of t he player .We also need t o check if t he player energy is 0 or less, and t hen dest roy t he player. This m eans t hat t he code should look about t he sam e as in t he “Player Enem y1Collision” script .Writ e down t his code in t he new script :Destroy the bullet with (other) instance_destroy()Lower the player’s energy myEnergy -global.bullet1Damage; Check if the energy is zero or less. if (myEnergy <0) instance_destroy()Not ice t hat I hav e use t he global variable “global.bullet 1Dam age” t o lower t he energy of t he player .This variable m ust be defined. That is done t hrough adding it t o t he “Gam eSt art ”script .Add t his line t o t hat script :global.bullet1Damage =10; This m eans t hat when t he enem y bullet hit s t he player, t he energy will be lowered by 10 unit s. Add t he “PlayerBullet 1Collision” script t o t he “obj Player” obj ect ,in t he collision ev ent wit h t he “obj Enem y1Bullet ”obj ect .Com pare t he t wo script s “PlayerBullet 1Collision” and “PlayerEnem y1Collision” The last “if” st at em ent and t he st at em ent it cont ains look t he sam e on t he t wo script s. The first line, t oo, look t he sam e, but we will ignore it for now. Since we use t he sam e block of code in m ore t han one place, it is a good idea t o put it in it s own script .So, creat e a new script and call it “CheckPlayer Energy” Copy t he ent ire “if” st at em ent fr om t he “PlayerBullet 1Collision” script t o t he new script ,so it looks like t his: Check if the energy is zero or less. if (myEnergy <0) instance_destroy()Then w e delet e t he “if” st at em ent s from t he ot her t w o script s, and inst ead call on t his new script .Just t o show how a script can be called from anot her script .I nst ead of t he “if” st at em ent s in t hose t wo script s, it should look like t his: CheckPlayerEnergy()Ther e. That is how easy it is t o use a script fr om anot her script .36 Beginners Guide to Game Maker Programming To be on t he safe side, here is a list of how t he ent ire “PlayerBullet 1Collision” script should look like: Destroy the bullet with (other) instance_destroy()Lower the player’s energy myEnergy –global.bullet1Damage; Check the player energy. CheckPlayerEnergy()And t he “PlayerEnem y1Collision” script :with (other) instance_destroy()myEnergy -global.enemy1Damage; CheckPlayerEnergy()Save t he gam e and t ry it .When t he enem y planes shoot at y ou, and you are hit ,t he energy will decrease unt il t he plane is dest r oy ed. Good. But wait !Once t he player plane is dest royed you get an error m essage saying “Unknown variable or funct ion” and referring t o t he “m ove_t owards_point ”funct ion when t he enem y bullet is creat ed. The reason for t his is t hat we m ade t he bullet s go for t he player plane, and once t he plane is dest royed, t he bullet s no longer know w here t o go. Or, m ore program m at ically speak ing, we ar e r eferring t o an inst ance t hat no longer exist s. So, we will have t o check if it exist s before firing t he bullet .Open up t he script “Enem y1Fire” This is where t he enem y bullet is cr eat ed. Now we need t o t est if an inst ance of t he “obj Player” is available. That can be done w it h t he “inst ance_exist s” funct ion. Here is it s definit ion: inst ance_exist s( obj )Ret urns whet her an inst ance of t ype obj exist s. obj can be an obj ect ,an inst ance id, or t he k eyw ord all. So, w e need t o use t he “if” st at em ent and t he “inst ance_exist s” funct ion in t he script .Make t he script look like t his: if (instance_exists(objPlayer))then {myBullet =instance_create(x, y, objEnemy1Bullet);with (myBullet) move_towards_point(objPlayer.x, objPlayer.y, 5);alarm[0] 60 +random(60);Not e t hat t he “alarm [0] set t ing is not included inside t he “if” st at em ent .That is because w e want t he script t o act ivat e a new alarm ev ent ev en if t he player plane does not exist at t he m om ent .Nice. This will only creat e t he bullet and m ove it if t he player plane exist s in t he gam e. 7.4 Meaning of life To round up t his program m ing guide, I t hink it would be a good idea t o add som e life t o t he gam e, as w ell as som e scoring. Open up t he script “Cr eat ePlayer ”This is wher e t he player inst ance is cr eat ed by t he “obj PlayerCont roller” Add t he line: playerLives =3; This m eans t hat t he num ber of lives t hat t he player has is st or ed in t he inst ance of t he “obj PlayerCont r oller” obj ect .Now we need t o decr ease t he num ber of lives every t im e t he player ex plodes. That is done in t he “CheckPlayer Energy ”script .Open it up. 37 Beginners Guide to Game Maker Programming I nside t he “if” st at em ent here, we want t o low er t he num ber of lives of t he “obj PlayerCont r oller” We also want t o m ak e sur e t hat t he player is cr eat ed again aft er som e t im e. For t hat ,we will use t he alarm funct ion of t he “obj PlayerCont roller” So, inside t he “if” st at em ent ,before t he “inst ance_dest r oy ”funct ion, add t hese lines: objPlayerController.playerLives -1; objPlayerController.alarm[0] 60; That will decr ease t he num ber of lives wit h 1, and set t he alarm 0 event of t he “obj PlayerCont roller” t o t rigger aft er 60 fram es (2 seconds) Tim e t o cr eat e a new script t hat t akes care of t he creat ion of t he new player, if t here are any lives left .Call t he script “LivesCheck” Here w e should check if t he player has any lives left ,and if so, creat e a new inst an
Dokumen baru
Aktifitas terbaru
Penulis

Gamecreators Beginners Guide To Game Maker..

Gratis

Feedback