Momwe mungapangire masewera pa kompyuta mu Game maker

Pin
Send
Share
Send

Ngati mukufuna kupanga masewera anu pakompyuta, ndiye muyenera kuphunzira momwe mungagwiritsire ntchito ndi mapulogalamu apadera opanga masewera. Mapulogalamu oterewa amakupatsani mwayi wopanga otchulidwa, kujambula makanema ojambula ndikusintha momwe awachitire. Zowonadi, iyi si mndandanda wonse wazotheka. Tiona njira yopanga masewera mu amodzi mwa mapulogalamu awa - Game Make.

Wopanga Masewera ndi imodzi mwama pulogalamu osavuta komanso otchuka popanga masewera a 2D. Apa mutha kupanga masewera pogwiritsa ntchito mawonekedwe a dra'n'drop kapena kugwiritsa ntchito chilankhulo cha GML (tidzagwira nawo ntchito). Wopanga Masewera ndiye njira yabwino kwambiri kwa iwo omwe akungoyamba kumene kupanga masewera.

Tsitsani Mapangidwe A masewera kwaulere

Momwe mungayikitsire Opanga Game

Tsatirani ulalo womwe uli pamwambapa ndipo pitani patsamba lovomerezeka la pulogalamuyo. Mudzatengedwera patsamba lotsitsa komwe mungapeze pulogalamu yaulere - Kutsitsa Kwaulere.

2. Tsopano muyenera kulembetsa. Lowetsani zofunikira zonse ndikupita ku bokosi la makalata komwe mukalandire kalata yotsimikizira. Tsatirani ulalo ndi kulowa muakaunti yanu.

3. Tsopano mutha kutsitsa masewerawo.

4. Koma si zokhazo. Tatsitsa pulogalamuyo, koma kuti mugwiritse ntchito muyenera chiphaso. Titha kuchipeza kwaulere kwa miyezi iwiri. Kuti muchite izi, patsamba lomwelo kuchokera komwe mudatsitsa masewerawo, mu "Onjezerani License", pezani tsamba la Amazon ndikudina batani loyang'ana "Dinani apa".

5. Pa zenera lomwe limatsegulira, muyenera kulowa muakaunti yanu pa Amazon kapena kupanga ndi kulowa.

6. Tsopano tili ndi kiyi yomwe mungapeze pansi pa tsamba limodzi. Koperani.

7. Timadutsa njira yodziwika kwambiri yoyika.

8. Nthawi yomweyo, okhazikitsa angatipatse kukhazikitsa GameMaker: Player. Timapanganso. Wosewera amafunikira masewera oyesa.

Izi zimaliza kukhazikitsa ndipo tikugwira ntchito ndi pulogalamuyi.

Momwe mungagwiritsire ntchito Opanga Masewera

Tsatirani pulogalamuyo. Mu gawo lachitatu, lowetsani chinsinsi cha layisensi yomwe tinakopera, ndipo chachiwiri timalowa ndi kulowa ndi mawu achinsinsi. Tsopano yambitsaninso pulogalamuyi. Amagwira ntchito!

Pitani ku tabu Yatsopano ndikupanga pulogalamu yatsopano.

Tsopano pangani sprite. Dinani kumanja pa Sprites kenako Pangani Sprite.

Mpatseni dzina. Lolani wosewera akhale ndikudina Sinthani Sprite. Iwindo lidzatsegulidwa momwe tingasinthire kapena kupanga sprite. Pangani sprite yatsopano, sitisintha kukula.

Tsopano dinani kawiri pazinthu zatsopano. Mu mkonzi womwe umatsegulira, titha kujambula sprite. Tikujambula wosewera, makamaka tank. Sungani chojambula chathu.

Kuti muwone makanema ojambula pamatanki athu, koperani ndi kumata chithunzicho ndi kuphatikiza Ctrl + C ndi Ctrl + V, motero, ndikusintha mawonekedwe ena pamalatawo. Mutha kupanga zambiri momwe mungathere. Zithunzi zambiri, zimasangalatsa makanema.

Tsopano mutha kuyang'ana bokosi pafupi ndi zowonera. Muwona makanema ojambula ndipo mutha kusintha mawonekedwe. Sungani chithunzicho ndikuchikhomera pogwiritsa ntchito batani la Center. Khalidwe lathu lakonzeka.

Munjira yomweyo, tifunika kupanga malo ena atatu: mdani, khoma ndi projectile. Aitane mdani, khoma ndi chipolopolo, motsatana.

Tsopano muyenera kupanga zinthuzo. Pa tsamba la Zinthu, dinani kumanja ndikusankha Pangani chinthu. Tsopano pangani chinthu chilichonse chosungira: ob_player, ob_enemy, ob_wall, ob_bullet.

Yang'anani!
Mukamapanga chinthu cha khoma, yang'anani bokosi la Solid. Izi zipangitsa khomalo kukhala lolimba ndipo akasinja sangathe kudutsamo.

Timatembenukira kwa ovuta. Tsegulani chinthu cha ob_player ndikupita ku Control tabu. Pangani chochitika chatsopano ndi batani la Chochitika Chosankha ndikusankha Pangani. Tsopano dinani kumanja pazinthu zomwe zikupereka.

Pazenera lomwe limatsegulira, muyenera kulembetsa zomwe tanki yathu ichitepo. Lembani izi:

hp = 10;
dmg_ time = 0;

Tipange chochitika cha Gawo chimodzimodzi, lembani code:

image_angle = point_direction (x, y, mbewa_x, mbewa_y);
ngati keyboard_check (ord ('W')) {y- = 3};
ngati keyboard_check (ord ('S')) {y + = 3};
ngati keyboard_check (ord ('A')) {x- = 3};
ngati keyboard_check (ord ('D')) {x + = 3};

ngati keyboard_check_rele (((W ')) {liwiro = 0;}
ngati keyboard_check_rele (((S ')) {liwiro = 0;}
ngati keyboard_check_rele (((A ')) {liwiro = 0;}
ngati keyboard_check_rele (((D ')) {liwiro = 0;}

Ngati mbewa_mangati_ino (mb_left)
{
ndi example_create (x, y, ob_bullet) {liwiro = 30; malangizo = point_direction (ob_player.x, ob_player.y, mbewa_x, mbewa_y);}
}

Onjezani chochitika cha Collision - kugundana ndi khoma. Code:

x = xpregic;
y = ypregic;

Ndipo onjezerani kuyanjana ndi mdani:

ngati dmg_time <= 0
{
hp- = 1
dmg_ time = 5;
}
dmg_ time - = 1;

Chojambula:

dzerani_ekha ();
Draw_xt (50,10, chingwe (hp));

Tsopano onjezani Gawo - Gawo lomaliza:
ngati hp <= 0
{
chiwonetsero ('Game over')
chipinda_restart ();
};
ngati Mwachitsanzo_number (ob_enemy) = 0
{
chiwonetsero ('Chipambano!')
chipinda_restart ();
}

Tsopano zomwe tatha ndi wosewera, pitani ku chinthu cha ob_enem. Onjezani Chochitika:

r ndi 50;
malangizo = kusankha (0.90,180,270);
liwiro = 2;
hp = 60;

Tsopano pakuyenda, onjezani Gawo:

ngati mtunda_to_object (ob_player) <= 0
{
malangizo = point_direction (x, y, ob_player.x, ob_player.y)
liwiro = 2;
}
mwinanso
{
ngati r <= 0
{
mayendedwe = kusankha (0.90,180,270)
liwiro = 1;
r ndi 50;
}
}
chithunzi_angle = kulowera;
r- = 1;

Pomaliza:

ngati hp <= 0 Mwachitsanzo_destroy ();

Timapanga chochitika Chowononga, pitani ku tabu ya kujambulako ndipo pazinthu zina dinani chizindikiro cha kuphulika. Tsopano, pakupha mdani, padzakhala kophulika.

Mgwirizano - kugundana ndi khoma:

mayendedwe = - kulondolera;

Mgwirizano - kugundana ndi projectile:

hp- = irandom_range (10.25)

Popeza khoma silichita chilichonse, timapita ku chinthu cha ob_bullet. Onjezani kuwombana ndi mdani:

mwachitsanzo_destroy ();

Kuphatikizana ndi khoma:

mwachitsanzo_destroy ();

Pomaliza, pangani Gawo 1. Gulani kumanja -> Pangani Chipinda. Tipita ku zinthu zomwe tazigwiritsa ntchito ngati "Wall" kujambula mapu. Kenako timawonjezera wosewera m'modzi ndi adani angapo. Mulingo wakonzeka!

Pomaliza, titha kuthamangitsa masewerawa ndikuwayesa. Ngati mumatsatira malangizowo, ndiye kuti payenera kukhala palibe nsikidzi.

Ndizo zonse. Tidasanthula momwe tingapangire masewera pa kompyuta tokha, ndipo mudamva lingaliro la pulogalamu monga Game Make. Pitilizani kukulitsa ndipo posachedwa mudzatha kupanga masewera osangalatsa komanso apamwamba kwambiri.

Zabwino zonse!

Tsitsani Wopanga Masewera kuchokera patsamba lovomerezeka

Onaninso: Mapulogalamu ena opanga masewera

Pin
Send
Share
Send