Cov txheej txheem:

2D Shooter Scratch Game: 11 Kauj Ruam
2D Shooter Scratch Game: 11 Kauj Ruam

Video: 2D Shooter Scratch Game: 11 Kauj Ruam

Video: 2D Shooter Scratch Game: 11 Kauj Ruam
Video: Code a Fun Space Shooter Game 馃殌 | 1. Move & Shoot | Scratch Tutorial 2024, Kaum ib hlis
Anonim
2D Shooter Scratch Game
2D Shooter Scratch Game

Hauv cov lus qhia no, Kuv yuav los qhia koj yuav ua li cas ua 2D tua phom khawb game. Nws yog qhov yooj yim zoo nkauj los ua, tab sis cia siab tias, koj yuav kawm qee yam ntawm txoj kev, thiab sai sai ua koj tus kheej kos ua si!

Khoom siv

  • Ib lub Computer.
  • Scratch ID nkag mus/Account.
  • Mouse (Ua si game thaum koj ua tiav yooj yim dua).

Kauj Ruam 1: Txoj Haujlwm Tshiab

Txoj Haujlwm Tshiab
Txoj Haujlwm Tshiab

Thawj qhov uas koj xav ua yog mus rau https://scratch.mit.edu/. Tom qab ntawd koj xav kos npe nrog koj tus lej nyiaj thiab nyem "Tsim".

Kauj Ruam 2: Ua Tus Sprite Tshiab

Ua Tus Tshiab Sprite
Ua Tus Tshiab Sprite
Ua Tus Tshiab Sprite
Ua Tus Tshiab Sprite

Thawj daim duab yog yam koj yuav tsum pom tom qab nyem qhov tsim khawm. Yam koj xav ua tam sim no yog nyem rau ntawm lub cim miv miv uas hais tias "sprite one", thiab tom qab ntawd nyem rau ntawm lub thoob khib nyiab khawm. Qhov no yuav tshem tawm qhov pib sprite kom peb tuaj yeem ua peb tus kheej. Tom ntej no, peb xav nyem rau ntawm lub cim miv nrog lub + kos npe, thiab tom qab ntawd xaiv xim. Tam sim no peb tuaj yeem ua peb tus thawj sprite.

Kauj Ruam 3: Tus Cawm Seej

Tus Cawm Seej
Tus Cawm Seej

Tam sim no peb xav ua peb tus yam ntxwv tseem ceeb, uas tus neeg ua si yuav tswj hwm. Siv cov cuab yeej nyob rau sab laug, ua lub voj voos me me uas nyob hauv nruab nrab, thiab siv cov cuab yeej kab thiab cov duab plaub los kos caj npab thiab rab phom. Koj tuaj yeem tau txais kev sim nrog cov xim yog tias koj xav tau, tab sis thawj zaug, tsuas yog sim ua kom nws zoo ib yam li qhov loj me thiab zoo ib yam li kuv li. Thaum kawg, thaum koj ua tiav, nyem rau ntawm kab ntawv uas nws hais tias sprite ib qho thiab hloov nws los hais "Player", ib yam li kuv ua. Nov tsuas yog ib txoj hauv kev rau peb kom paub tias "Player", yog hais txog peb tus yam ntxwv tseem ceeb.

Kauj Ruam 4: Tus Neeg Phem

Tus Neeg Phem
Tus Neeg Phem

Tam sim no peb tau ua peb tus yam ntxwv tseem ceeb, peb yuav tsum ua qee yam rau tus yam ntxwv ntawd los sib ntaus. Siv cov cuab yeej ntawm sab laug, ib zaug ntxiv, ua tib yam li hauv qib 3, tab sis muaj caj npab ncaj thiab tsis muaj phom. Ua kom nws txog qhov loj ib yam li "Player", thiab xyuas kom tseeb tias lub ntsej muag tig mus ncaj nraim. Thaum kawg, hloov nws raws li peb tau ua hauv theem 3 rau qee yam xws li "BadGuy". Ua ntej peb txav mus rau qib tom ntej, nyem lub cim nraub qaum nyob rau hauv qab sab laug thiab xaiv xim.

Kauj Ruam 5: Tom Qab

Keeb Kwm
Keeb Kwm

Thaum koj tau nyem rau ntawm lub cim xim los ntawm kauj ruam 4, siv lub cuab yeej duab plaub los ua keeb kwm yav dhau los ntawm cov xim uas koj xaiv ib yam li koj tau kos cov sprites. Nco ntsoov tshem cov keeb kwm yav dhau dawb uas tau ua rau koj, yog li keeb kwm yav dhau los uas koj muaj yog qhov no. Tom qab ntawv kawg, npe nws rau qee yam xws li "Tom Qab".

Kauj Ruam 6: Game Over Background

Game Over Background
Game Over Background

Nyem rau ntawm lub cim xim dua thiab ua keeb kwm yav dhau los thib ob siv cov cuab yeej ntawv los ua qee yam uas zoo li qhov no. Hloov nws mus rau GameOver, lossis qee yam zoo sib xws, thiab txav mus rau qib tom ntej.

Kauj Ruam 7: Ib rab phom

Ib rab phom
Ib rab phom

Tam sim no peb tab tom ua lub mos txwv uas peb cov neeg ua si tuaj yeem tua ntawm cov neeg phem. Qhov no yog qhov yooj yim dua li lwm cov sprites, thiab txhua yam koj yuav tsum ua yog ua cov duab plaub kab rov tav me me, nyob rau nruab nrab ntawm qhov kos npe rau nruab nrab. Tom qab ntawd npe nws "Bullet", thiab mus rau kauj ruam tom ntej.

Kauj ruam 8: Coding

Coding
Coding

Ua ntej, xaiv "Player" Sprite tsim lub kaum sab laug hauv qab uas peb tau ua ua ntej. Tom qab ntawd, nyob rau sab laug saum toj kawg nkaus qhov uas nws hais tias code, khaub ncaws, thiab suab, nyem rau ntawm tus lej. Koj tuaj yeem nqes mus thiab nqis los ntawm cov xim-coded blocks, thiab rub thiab tso cov blocks rau ntawm qhov chaw ua haujlwm. Txhawm rau tshem tawm ib qho thaiv, rub nws rov mus rau sab laug. Tau siv txav, tshem tawm, thiab tshem tawm cov block. Los ntawm kev saib los ntawm cov lej thaiv, rov tsim cov cai hauv daim duab. Thaum koj mus rau "Tshaj Tawm" thaiv, koj yuav tshaj tawm xov xwm tshiab, thiab lub npe nws "Tua", thiab tom qab ntawd xaiv nws hauv qhov thaiv uas tau teeb tsa hauv cov ntawv qhia zaub mov nco.

Txoj cai no tau ua yog tso cai rau tus neeg ua si txav nrog WASD (nce, sab laug, nqes, thiab sab xis). Nws tseem tab tom pib sprite nyob nruab nrab ntawm qhov screen. Txoj cai ntawm txoj cai yog yuav ua li cas peb tau txais cov mos txwv los tua. Yog tias koj tsis nkag siab ib qho ntawm qhov no, tsis ua li cas, tsuas yog theej cov cai, thiab pom tias koj tuaj yeem txheeb xyuas seb nws ua haujlwm li cas.

Kauj ruam 9: Kev tua

Tua
Tua

Ib zaug ntxiv, zoo li hauv qib 8, koj yuav rov tsim cov cai hauv daim duab, tab sis ntawm tus mos txwv sprite (nyem rau ntawm "Bullet" sprite nyob hauv qab txoj cai).

Txoj cai no ua haujlwm nrog cov cai ntawm "Player", thiab ua rau kom thaum twg los xij tus nas tuav, nws tsim cov clone ntawm cov mos txwv (tso cai rau kom muaj ntau lub mos txwv sprites ib zaug) nyob rau hauv pem hauv ntej ntawm tus neeg uas ua ntawv kom nws zoo li zoo li nws tau tawm los ntawm tus neeg uas ua ntawv rab phom, thiab tom qab ntawd txav mus rau qhov kev taw qhia uas koj tus nas tau taw tes. Qhov no ua rau tus neeg ua si qhov kev muaj peev xwm tsom thiab tua cov mos txwv.

Kauj Ruam 10: Tus Neeg Tsis Txaus Siab Code

Tus Neeg Tsis Txaus Siab Code
Tus Neeg Tsis Txaus Siab Code
Tus Neeg Tsis Txaus Siab Code
Tus Neeg Tsis Txaus Siab Code

Tej zaum qhov no yog qhov nyuaj tshaj plaws thiab tseem ceeb tshaj txoj cai. Xaiv tus "BadGuy" sprite, thiab tom qab ntawd ua kom ntseeg tau tias txhua yam zoo li daim duab. Hauv ib feem ntawm txoj cai, peb yuav tsum ua kom muaj qhov sib txawv. Peb ua qhov no ib yam nkaus uas peb tau tshaj tawm xov xwm. Nco ntsoov tias "rau txhua tus sprites" kuj tau xaiv. Peb kuj yuav tsum tshaj tawm xov xwm thib ob hu ua GameOver.

Txoj cai no ua rau nws kom tus txiv neej phem ua clones uas tshwm sim ntawm qhov ntug ntawm qhov screen. Nws kuj tseem ua rau kom tus neeg phem ib txwm ua raws tus neeg ua si, tuag thaum lub mos txwv tsoo nws, thiab qhov kev ua si xaus thaum ib tus Neeg Phem Tuav Tus Neeg Ua Si.

Kauj Ruam 11: Kauj Ruam Kawg

Kauj Ruam Kawg
Kauj Ruam Kawg
Kauj Ruam Kawg
Kauj Ruam Kawg
Kauj Ruam Kawg
Kauj Ruam Kawg

Thaum kawg, ntxiv Cov Cai hauv daim duab sab laug rau "Player", cov cai hauv daim duab saum toj sab xis rau "Bullet", thiab cov cai hauv daim duab thib peb mus rau "BadGuy". Nov yog qhov peb txwv txhua yam tsis tshwm sim thaum qhov kev ua si tas thiab xaus qhov kev ua si. Koj ua nws! Txheeb Ob Zaug tias txhua yam raug cim kom raug. Nyem rau ntawm "Saib nplooj ntawv qhov project" nyob rau sab saum toj thiab mus ua si koj cov game! Nyem rau tus chij ntsuab kom khiav txoj cai thiab lub cim nres liab kom nres txoj cai. Yog tias koj xav pom ib qho uas kuv tau ua, lossis ob zaug txheeb xyuas koj cov cai, mus ntawm no: https://scratch.mit.edu/projects/381823733/. Xav tias dawb ntxiv yam tshiab, zoo li cov qhab nia siab, noj qab haus huv, puas tsuaj, thiab phom sib txawv. Muaj Kev Lom Zem!

Pom zoo: