Cov txheej txheem:

Sib Ntaus Lub Nroog Remake ntawm GameGo Nrog Makecode Arcade: 4 Cov Kauj Ruam (nrog Duab)
Sib Ntaus Lub Nroog Remake ntawm GameGo Nrog Makecode Arcade: 4 Cov Kauj Ruam (nrog Duab)

Video: Sib Ntaus Lub Nroog Remake ntawm GameGo Nrog Makecode Arcade: 4 Cov Kauj Ruam (nrog Duab)

Video: Sib Ntaus Lub Nroog Remake ntawm GameGo Nrog Makecode Arcade: 4 Cov Kauj Ruam (nrog Duab)
Video: Tseem Ev Lub Kawm - Koos Loos 2024, Kaum ib hlis
Anonim
Image
Image

GameGo yog Microsoft Makecode tau tshaj retro gaming portable console tsim los ntawm TinkerGen STEM kev kawm. Nws yog ua raws STM32F401RET6 ARM Cortex M4 nti thiab ua rau STEM cov kws qhia lossis tsuas yog cov neeg uas nyiam muaj kev lom zem tsim retro video games. Koj tuaj yeem ua raws cov lus qhia no thiab sim ua si hauv Makecode Arcade simulator thiab tom qab ntawd ua nws ntawm GameGo.

Hauv tsab xov xwm no peb yuav sim peb txhais tes ntawm kev rov tsim dua ib qho kev sib ntaus sib tua City City tank shooter game, thaum xub thawj tsim thiab luam tawm xyoo 1985 los ntawm Namco rau Nintendo Entertainment System (NES). Hauv qhov kev ua si thawj tus neeg uas ua ntawv tswj lub tank thiab tua projectiles los rhuav tshem cov yeeb ncuab tso tsheb hlau luam. Cov yeeb ncuab tso tsheb hlau luam sim rhuav tshem cov neeg ua si lub hauv paus, ntxiv rau cov neeg ua si lub tank nws tus kheej. Peb yuav ua qee qhov kev hloov kho rau kev ua si game kom zoo dua txhawm rau thaiv kev ua haujlwm nrog GameGo, tab sis peb qhov kev rov ua dua tseem yuav khaws ntau qhov zoo sib xws rau thawj qhov kev ua si. Cia peb pib!

Khoom siv

GameGo

Kauj Ruam 1: Peb Hloov -ego - Tank daj

Peb Hloov -ego - Tank daj
Peb Hloov -ego - Tank daj

Qhib Makecode Arcade ntawm https://arcade.makecode.com/ thiab nyem rau ntawm qhov haujlwm tshiab. Peb yuav pib kuv ua peb hloov-ego lub tank daj. Xaiv Teeb mySprite txhawm rau ua kom zoo ntawm cov neeg ua si thaiv thiab kos lub tank daj tig mus rau sab saum toj raws li peb pib sprite, tso qhov thaiv sab hauv ntawm qhov pib thaiv. Ntxiv txav mySprite nrog khawm thaiv. Tam sim no peb muaj lub tank uas peb tuaj yeem txav nrog cov nyees khawm hauv simulation! Zoo heev, tab sis nws ib txwm ntsib tib txoj kev qhia, txawm tias thaum peb txav mus los lossis ib sab …

Txhawm rau kho qhov ntawd, cia peb ntxiv plaub ntu ntxiv, ib qho rau txhua qhov kev taw qhia khawm. Tsim qhov hloov pauv tshiab, hu ua kev taw qhia - peb yuav txuag txoj kev txav ntawm peb lub tank hauv nws, 100 yuav sib haum mus rau, -100 yuav sib haum mus, 200 rau sab xis thiab -200 rau sab laug. Vim li cas cov lej no? Koj yuav pom tom qab, thaum peb ntxiv cov projectiles uas peb lub tank yuav tua. Cov laj thawj hauv txhua plaub ntawm cov thaiv no yog qhov yooj yim heev - peb tshawb xyuas yog tias cov lus qhia tshiab (los ntawm nias lub pob) zoo ib yam li cov lus qhia ua ntej. Yog tias yog, peb yeej tsis hloov pauv dab tsi. Yog tias nws tsis yog peb hloov lub tank sprite thiab nyob rau hauv cov ntaub ntawv nqes thiab sab laug peb tig lub sprite cov duab kom tsis txhob kos duab ntxiv. Thaum kawg cia peb muab tus nqi pib ntawm kev taw qhia rau -100 (tank nce), txij li qhov no yog li cas peb lub tank pib qhov kev ua si. Sim txav lub tank daj tam sim no, tus sprite yuav hloov raws li kev taw qhia ntawm kev txav tam sim no! Zoo heev, tam sim no cia ntxiv cov mos txwv.

Peb yuav tua cov mos txwv nrog teeb tsa projectile mus rau projectile (kos cov nyiaj me me rau lub sprite ntawd) los ntawm mySprite nrog vx vy nrawm. Sab hauv ntawm lub khawm A nias thaiv, peb yuav tsum txheeb xyuas qhov muaj txiaj ntsig ntawm kev taw qhia kom pom tias lub tank daj tab tom ntsib/nce ntawm sab laug/sab xis. Peb tom qab ntawd pib tua lub projectile nrog qhov nrawm ntawm qhov taw qhia sib txawv -yog vim li cas peb thiaj li muaj -100/100/-200/200 rau kev coj ua qhov tseem ceeb.

Tam sim no peb muaj lub tank daj uas tuaj yeem tua cov projectiles thiab txav mus. Yog tias cov roj tso dej daj sim tuaj yeem muaj kev xav nws yuav zoo li nyob ib leeg hauv qhov khoob khoob no yam tsis muaj yeeb ncuab thiab yam ua. Yog li, rau qib tom ntej cia ntxiv cov yeeb ncuab rau nws kom dhau sijhawm.

Kauj Ruam 2: Tshem Tawm Cov Yeeb ncuab

Coj Cov Yeeb ncuab tawm
Coj Cov Yeeb ncuab tawm
Coj Tawm Cov Yeeb ncuab
Coj Tawm Cov Yeeb ncuab

Peb yuav pib cov kauj ruam no los ntawm kev tsim cov pawg hloov pauv tshiab: ob qhov chaw (ib qho rau tuav cov yeeb ncuab sprites thiab lwm qhov rau tuav cov yeeb ncuab qhia), spawn lub sijhawm sib txawv rau khaws cia lub sijhawm ntawm spawns, suav yeeb ncuab rau khaws ntau tus yeeb ncuab tib lub sijhawm. Peb tseem yuav ntxiv ob lub foob pob (projectile thiab cov yeeb ncuab projectile) tua thaum pib thaiv - uas yuav pab peb kom zam kev ua yuam kev tom qab.

Tom ntej no peb tsim ntawm game hloov tshiab txhua txhua… ms thaiv, ntxig spawn_time sib txawv muaj. Qhov logic sab hauv ntawm qhov thaiv yog yooj yim - yog tias tag nrho cov yeeb ncuab ntawm tshav rog sib ntaus tsawg dua qhov tso cai tus naj npawb ntawm cov yeeb ncuab, ntxiv tus yeeb ncuab rau yeeb ncuab_sprite_list thiab ntxiv 200 (mus rau txoj cai) kev taw qhia rau tus yeeb ncuab ntawd.

Tom ntej no, hauv qhov tsim cov sprite ntawm hom Enemy block peb ntxiv qee cov duab nraaj, tso nws rau ntawm cov nplais npliag thiab hu rau pick_direction muaj nuj nqi rau cov sprite no. Nyob rau ntawm qhov zoo ntawm tus yeeb ncuab ntaus phab ntsa, peb hu tib txoj haujlwm, xaiv_direction.

Dab tsi yog hauv txoj haujlwm ntawd? Nov yog qhov uas pib ua kom nyuaj me ntsis, yog li tuav. Muaj 50 feem pua ntawm cov yeeb ncuab lub tank nce thiab 50 feem pua ntawm nws nqis mus - peb hloov cov sprite raws li. Qhov ua kom yuam kev ntawm no tsuas yog tias peb tseem yuav tsum hloov tus nqi sib xws rau lub tank tus yeeb ncuab tshwj xeeb hauv tus yeeb ncuab_directions_list rau nws qhov kev qhia tshiab, yog li peb xav kom nws tua cov mos txwv raws li txoj cai. Rau qhov peb pom qhov ntsuas ntawm tus yeeb ncuab sprite hauv tus yeeb ncuab_sprite_list thiab hloov cov khoom ntawd tus nqi hauv cov yeeb ncuab_directions npe.

Thaum kawg, cia ntxiv kev txhaj tshuaj. Peb ntxiv lwm qhov ntawm kev hloov kho game txhua txhua 500 ms thaiv thiab muab cov khoom rau hauv yeeb ncuab_sprite_list. Nrog 30% txoj hmoo tus yeeb ncuab sprite yuav tua cov yeeb ncuab projectile hauv nws txoj kev txav mus los.

Yog tias peb tso qhov kev ua si hauv simulation tam sim no, peb tuaj yeem pom peb lub tank daj thiab cov yeeb ncuab tso tsheb hlau luam tshwm rau tib qho chaw thiab nkag mus rau qhov chaw khoob. Peb tuaj yeem tua thiab lawv tuaj yeem tua peb lub tank daj, tab sis tsis muaj dab tsi yuav tshwm sim. Nws zoo li tsis muaj lub ntsiab lus tseem:) Cia peb ntxiv cov kho kom zoo nkauj thiab cov tshuab ua si raws li qib kawg.

Kauj Ruam 3: 42 ntawm Game

42 ntawm Game
42 ntawm Game
42 ntawm Game
42 ntawm Game
42 ntawm Game
42 ntawm Game

Peb tab tom yuav pib qib no los ntawm kev ntxiv lub neej thiab cov qhab nia los ntawm Cov Ntaub Ntawv tab thiab teeb tsa lub neej rau 10 thiab qhab nia rau xoom. Tom qab ntawd peb ntxiv block teeb tsa daim duab qhia chaw rau…. Kos daim ntawv qhia chaw kom pom qee yam zoo li koj pom hauv lub screenshot saum toj no. Tsis txhob hnov qab ntxiv cov phab ntsa!

Cia peb ntxiv rau ntawm qhov zoo ntawm Projectile sib tshooj rau lwm tus neeg siab zoo - qhov no yog thaum cov yeeb ncuab lub mos txwv tsoo peb lub tank daj. Peb yuav tsum ua kom ntseeg tau tias cov phiaj xwm no yog cov yeeb ncuab lub mos txwv thiab tsis yog peb tus kheej, yog li peb yuav ntxiv qhov ntawd yog qhov xwm txheej hauv qhov thaiv thiab yog tias nws ntsuas qhov tseeb, ces peb rho tawm ib qho ntawm suav lub neej. Zoo ib yam rau nws, hauv lwm qhov thaiv ntawm qhov zoo ntawm Projectile sib tshooj lwm yam Kev ywj pheej ntawm hom yeeb ncuab peb ua kom ntseeg tau tias qhov projectile yog qhov projectile los ntawm lub tank daj thiab yog tias qhov xwm txheej no tshuaj xyuas qhov tseeb, peb rhuav tshem lwm yam (Cov yeeb ncuab tank), tshem nws tawm ntawm cov npe ntawm tus yeeb ncuab_sprite_list thiab ntxiv ib tus qhab nia.

Qhov kawg yog kev yeej thiab yeej qhov xwm txheej - rau kev yeej, peb yuav tshuaj xyuas yog tias cov qhab nia siab dua lossis sib npaug 10 hauv ib txhis thaiv. Yog tias yog, ces peb qhia qhov screen kov yeej. Thiab hauv lub neej xoom thaiv peb qhia Game Over screen.

Tam sim no sim nws hauv qhov kev sim kom pom tias qhov kev ua si tau ua haujlwm raws li qhov xav tau. Tom qab ntawd rub nws mus rau GameGo thiab txaus siab rau tsoo cov yeeb ncuab tso tsheb hlau luam!

Kauj Ruam 4: Kev Ua Si Tsis Txaus thiab Txhim Kho

Kev Ua Si Tsis Txaus thiab Kev Txhim Kho
Kev Ua Si Tsis Txaus thiab Kev Txhim Kho

Hauv peb GitHub chaw cia khoom koj tuaj yeem rub ob daim ntawv rau Makecode arcade - ib qho yog qhov zoo ib yam uas koj yuav tau txais yog tias koj ua raws cov lus qhia no thiab lwm qhov yog hloov kho dua tshiab, uas tau tsim ua ntu zuj zus. Nws muaj 10 qib, txhua tus tau tsim los tsim nrog cov naj npawb ntawm cov yeeb ncuab hauv txhua qib ua tiav

Thiab ntawm chav kawm, muaj ntau yam ntxiv uas koj lossis koj cov tub ntxhais kawm tuaj yeem ntxiv rau qhov kev ua si nyob rau sab saum toj ntawm qhov ntawd! Muaj suab paj nruag zoo dua, phab ntsa tawg, sib txawv yeej yeej thiab lwm yam!

Yog tias koj ua qhov hloov kho ntawm qhov kev ua si, qhia nws hauv cov lus hauv qab no! Yog xav paub ntau ntxiv txog GameGo thiab lwm yam khoom siv kho vajtse thiab kws qhia txuj ci STEM, mus saib peb lub vev xaib, https://tinkergen.com/ thiab sau npe rau peb qhov blog.

TinkerGen tau pib Kickstarter phiaj los nqis tes rau MARK (Ua Cov Khoom Siv Neeg Hlau), cov cuab yeej neeg hlau rau kev qhia paub coding, neeg hlau, AI!

Pom zoo: