Cov txheej txheem:
- Kauj Ruam 1: Ua Ntej
- Kauj Ruam 2: Ua Noog Tsiv
- Kauj Ruam 3: Ua Obstacles
- Kauj Ruam 4: Ua Obstacles Tsiv
- Kauj Ruam 5: Ua kom Obstacles ploj mus
- Kauj Ruam 6: Tsim Ntau Yam Teeb Meem
- Kauj ruam 7: Game Over
- Kauj Ruam 8: Caij Nplooj Ntoos Zeeg
Video: Crashy Bird: 8 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:26
Koj yuav xav tau: Lub khoos phis tawj Ib lub micro-ntsis A miro USB cable Uas yog txhua yam koj xav tau, tab sis qhov zoo dua koj yuav tsum muaj tag nrho Micro-ntsis khoom siv los ua qhov no. Txhawm rau ua tus lej koj kuj yuav tsum tau mus rau lub vev xaib ua tus lej. Yog tias koj tsis paub nrog lub vev xaib no koj yuav tsum sim nws.
Kauj Ruam 1: Ua Ntej
Txhawm rau ua noog koj yuav tsum xub ua qhov sib txawv "noog" ces koj tau mus rau qeb "sib txawv" thiab nqes mus thiab koj yuav pom "teeb sprite rau" blank "" tom qab ntawd mus rau "game" thiab koj yuav pom "tsim sprite" ntawm x blank, y blank ". Teeb x ntawm 0 thiab y ntawm 2. Tam sim no koj yuav tsum muaj tus cim nyob ntawd tab sis peb xav ua kom nws ntsais li ntawd nws thiaj li nthuav. Yog li peb rov qab mus rau pawg sib txawv thiab nyob ntawd koj yuav tsum pom "khoob teeb dawb rau" ntawm qhov khoob koj rov qab mus rau qhov sib txawv thiab muab "noog" ntawm thawj qhov khoob thiab hauv qhov thaiv thib ob xaiv ntsais muag. Cov cai yuav tsum zoo li cov duab nyob saum.
Kauj Ruam 2: Ua Noog Tsiv
Yog li peb xav kom tus noog nce mus thiab peb xav kom tus noog nce mus. Txhawm rau ua qhov yooj yim, koj mus rau "nkag", nyob ntawd koj yuav pom "ntawm khawm A nias" koj yuav tsum tso qhov ntawd rau hauv koj cov cai. Tom qab ntawd mus rau qeb hu ua "game" nyob ntawd koj yuav pom "sprite hloov x los ntawm 1" coj qhov ntawd thiab muab tso rau sab hauv "ntawm khawm A nias" ces hloov x rau y thiab 1 txog -1. Ua tib yam tab sis hloov A hauv "ntawm khawm A nias" rau B thiab hloov -1 rau 1. Qhov ntawd yuav tsum cia koj txav koj cov noog. Daim duab ntawm tus lej yuav nyob ntawm cov duab saum toj no.
Kauj Ruam 3: Ua Obstacles
Ok, qhov no yuav yog kauj ruam ntev thiab nyuaj heev. Yog li cia peb pib. Txhawm rau pib nrog qhov no peb xav tau txhua qhov kev cuam tshuam hauv ib kab lossis kab. Yog li peb yuav ua qhov hloov pauv hu ua "teeb meem" tom qab ntawd koj yuav tsum nqes mus nrhiav lub pob "teeb tsa (xaiv qhov sib txawv) mus rau" dawb paug "" koj yuav tsum xaiv qhov sib txawv ua "teeb meem" thiab tom qab ntawd koj yuav tsum mus rau qeb "arrays" nyob ntawd koj yuav tsum nqes mus nrhiav "khoob khoob" koj yuav tsum coj qhov ntawd thiab muab qhov ntawd tso rau hauv qhov chaw khoob. Tom qab ntawd koj xav kom cov teeb meem tsis zoo, thiab tseem xav tau lub qhov nyob hauv qhov teeb meem rau tus noog hla mus. Txhawm rau ua qhov ntawd peb yuav ua lub qhov ua ntej. Peb thawj zaug yuav ua qhov hloov pauv hu ua "emptyobstacle". Tom qab ntawd peb yuav siv tib "teeb tsa (xaiv qhov sib txawv) rau (tsis muaj dab tsi)" hauv qhov sib txawv peb yuav siv qhov sib txawv "khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khawm" hauv qhov khoob peb yuav mus rau qeb "lej" nyob ntawd koj yuav tsum muaj "xaiv random los ntawm 0 txog 10" coj qhov ntawd thiab muab tso rau hauv qhov khoob. Tom qab ntawd hloov qhov 10 mus rau 4. Tam sim no, qhov no tso cai rau lub qhov kom raug. Tam sim no peb tab tom ua "rau" lub voj los ua qhov teeb meem rau txhua qhov chaw qhib hauv kab. Txhawm rau ua qhov ntawd peb mus rau qeb kab thiab muaj peb muaj "rau qhov ntsuas los ntawm 0 txog 4 ua" peb xav tau qhov no yog li, peb muab nws tso rau hauv "thaum pib" tom qab ntawd peb mus rau qhov laj thawj thiab coj "yog tias yog" thiab muab tso rau hauv "rau qhov ntsuas los ntawm 0 txog 4" tom qab ntawd peb rov qab mus rau qeb kev xav thiab coj "blank = blank" thiab peb hloov qhov tseeb nrog nws. Thawj qhov khoob peb tso "ntsuas" thiab ntawm qhov thib ob khoob peb tso "khoob khoob khoob khoob khoob". thiab peb hloov qhov "=" rau qhov tsis sib npaug "kos npe. qeb "game" thiab muaj peb coj "tsim sprite ntawm x: blank, y: blank" tom qab ntawd peb muab qhov ntawd tso rau qhov khoob. Tam sim no koj yuav tsum muaj tus noog thiab teeb meem. Txoj cai yuav nyob hauv cov duab thiab tshawb xyuas yog tias koj ua qhov no raug.
Kauj Ruam 4: Ua Obstacles Tsiv
Tam sim no peb xav tau cov nyom kom txav mus vim tias qhov kev ua si tuaj yeem mus ntxiv. Yog li tam sim no los ua qhov xub thawj, peb yuav tsum tau tsim lwm qhov sib txawv "teeb meem". Tom qab ntawd peb mus rau ntu ntu thiab nyob ntawd peb coj "rau lub ntsiab lus ntawm kev xaiv qhov sib txawv ua" tom qab ntawd peb muab qhov ntawd "nyob mus ib txhis" thiab tom qab ntawd peb mus rau qeb kev ua si thiab peb coj "xaiv qhov sib txawv hloov x los ntawm qhov khoob" peb xaiv qhov sib txawv raws li "teeb meem" thiab peb tso -1 hauv qhov khoob. Tom qab ntawd peb mus rau qeb "yooj yim" thiab muaj peb tso "ncua ms blank" thiab peb hloov qhov khoob nrog 200. Muaj cov kauj ruam 4. Cov duab ntawm cov cai yuav nyob saum toj.
Kauj Ruam 5: Ua kom Obstacles ploj mus
Tam sim no peb yuav tsum ua kom cov nyom dhau mus ploj mus. Txhawm rau ua qhov no peb yuav tsum xub xub nkag mus rau ntu "voj" thiab muaj qhov "thaum tsis ua" thiab muab tso rau hauv "mus ib txhis" tom qab ntawd peb yuav tsum mus rau qhov laj thawj thiab tso "khoob thiab khoob" hauv dawb paug Tom qab ntawd peb yuav tsum rov qab mus thiab tso "blank = to blank" hauv ob qho tib si ntawm qhov logic block. Tom qab ntawd peb yuav tsum mus rau qeb "array" thiab peb siv qhov "ntev ntawm array blank" thiab peb hloov qhov khoob nrog qhov sib txawv "teeb meem" thiab peb hloov qhov kos npe sib npaug rau ntau dua thiab peb sau 0 hauv qhov khoob. Tom qab ntawd peb mus rau "game" thiab coj "blank x", tom qab ntawd mus rau qhov laj thawj thiab tau txais qhov thaiv tib yam li ua ntej, tom qab ntawd peb mus rau "array" thiab coj "tau txais tus nqi ntawm qhov khoob" peb tso 0 ntawm qhov khoob. tom qab ntawd peb muab = thiab hloov qhov khoob nrog 0. Tom qab ntawd rov qab mus rau "game" thiab tau txais "rho tawm qhov khoob". Tom qab ntawd peb mus rau "pawg" pawg thiab nrhiav "khoob tshem tus nqi ntawm 0" thiab muab qhov ntawd tso rau hauv qhov khoob. Tam sim no qhov no yuav ua rau cov teeb meem ploj mus ntawm x = 0 thiab qhov kev ua si yuav tsis txwv nrog tus lej ntawm cov teeb meem. Daim duab ntawm tus lej yuav nyob saum toj.
Kauj Ruam 6: Tsim Ntau Yam Teeb Meem
Tam sim no peb yuav tsum tsim kom muaj ntau yam kev cuam tshuam, yog li ua qhov ntawd peb yuav tsum tso tag nrho cov cai uas cuam tshuam nrog cov teeb meem hauv qhov thaiv tas mus li. Tam sim no peb yuav tsum muaj chaw nyob nruab nrab ntawm cov teeb meem thiab ua li ntawd peb tsuas yog xav tau ntxiv zuam. Peb tuaj yeem ua qhov ntawd los ntawm kev mus rau "qhov sib txawv" qeb thiab muab "hloov zuam los ntawm 1" thiab peb kuj tso qhov ntawd rau hauv qhov thaiv mus ib txhis thiab tom qab ntawd peb yuav tsum muaj qhov chaw nruab nrab ntawm cov teeb meem. Qhov thaiv ib txhis yuav nyob hauv daim duab saum toj.
Kauj ruam 7: Game Over
Tam sim no peb xav tau qhov kev ua si kom xaus yog tias noog kov cov teeb meem. Txhawm rau ua qhov no peb yuav tsum tam sim no fo rau "voj" qeb thiab muaj peb yuav tsum tau coj "rau lub ntsiab lus ntawm qhov khoob ua" Tom qab ntawd peb yuav tsum tso qhov sib txawv "teeb meem" hauv thawj qhov khoob thiab tom qab ntawd tom ntej no peb xav tau muab qhov sib txawv "obstacles". Tam sim no peb yuav tsum mus rau qeb "logic" thiab coj "yog tias muaj tseeb ces ua" thiab muab qhov ntawd ua. Tom qab ntawd peb rov qab mus rau "logic" thiab tau txais "blank and blank" thiab peb hloov nws nrog qhov tseeb. Tom qab ntawd peb coj "blank = blank" los ntawm pawg logic thiab muab tso rau hauv ob qho tib si. Tom qab ntawd peb mus rau "game" thiab coj "sprite x" thiab muab qhov ntawd tso rau hauv thawj qhov chaw ntawm "blank = blank" thiab peb coj nws dua thiab muab qhov ntawd tso rau lwm qhov khoob ib yam nkaus. Tom qab ntawd peb hloov thawj tus sprite nrog cov noog sib txawv thiab lwm tus sprite nrog cov nyom sib txawv. Tom qab ntawd nyob rau lwm qhov ntawm qhov "khoob thiab khoob" peb ua tib yam tab sis peb hloov x rau y rau ob qho kev hloov pauv. Tom qab ntawd, peb mus rau qeb kev ua si dua thiab coj qhov kev ua si hla ntu thiab muab tso rau hauv qhov thaiv "yog tias" hauv qab "ces". Tam sim no koj qhov kev ua si xaus thaum tus noog kov cov teeb meem. Txoj cai no tseem yuav tsum nyob hauv qhov thaiv tas mus li. Daim duab ntawm tus lej no yuav nyob ntawm daim duab saum toj.
Kauj Ruam 8: Caij Nplooj Ntoos Zeeg
Tam sim no peb tseem xav tau noog kom poob yog li nws nyuaj rau tus neeg ua si. Koj tuaj yeem ua qhov ntawd los ntawm kev mus rau qeb kev ua si thiab coj "sprite hloov x los ntawm 1" thiab hloov "sprite" nrog cov noog sib txawv thiab x rau y thiab tso qhov ntawd mus ib txhis. Qhov kawg Code yuav nyob hauv cov duab. Qee qhov kev hloov pauv uas koj tuaj yeem ua tau yog muaj nkauj nyob hauv keeb kwm yav dhau los lossis muaj tus lej ntsuas.
Pom zoo:
Arduino Tsheb Rov Qab Chaw Nres Tsheb Ceeb Toom - Cov Kauj Ruam ntawm Kauj Ruam: 4 Kauj Ruam
Arduino Tsheb Rov Qab Chaw Nres Tsheb Ceeb Toom | Cov kauj ruam ib kauj ruam: Hauv txoj haujlwm no, kuv yuav tsim qhov yooj yim Arduino Tsheb Rov Qab Tsheb Nres Tsheb Nres Sensor Siv Arduino UNO thiab HC-SR04 Ultrasonic Sensor. Qhov no Arduino raws Lub Tsheb Rov Qab ceeb toom tuaj yeem siv rau Kev Tshawb Fawb Txog Tus Kheej, Robot Ranging thiab lwm yam
Tsev Automation Kauj Ruam ntawm Kauj Ruam Siv Wemos D1 Mini Nrog PCB Tsim: 4 Kauj Ruam
Tsev Automation Kauj Ruam Ib Leeg Siv Wemos D1 Mini Nrog PCB Tsim: Tsev Automation Kauj Ruam los ntawm Kauj Ruam siv Wemos D1 Mini nrog PCB Tsim cov tub ntxhais kawm ntawv qib siab. Tom qab ntawd ib tus ntawm peb cov tswv cuab tuaj
RC Taug Qab Neeg Hlau Siv Arduino - Kauj Ruam Ib kauj ruam: 3 Kauj Ruam
RC Tracked Robot Siv Arduino - Kauj Ruam Ib Nrab: Hav guys, Kuv rov qab los nrog lwm tus neeg hlau txias chassis los ntawm BangGood. Vam tias koj tau dhau los ntawm peb cov phiaj xwm yav dhau los - Spinel Crux V1 - Tus Cwj Pwm Tswj Tus Neeg Hlau, Spinel Crux L2 - Arduino Xaiv thiab Muab Neeg Hlau nrog Robotic caj npab thiab Badland Braw
Arduino Flappy Bird - Arduino 2.4 "TFT Touchscreen SPFD5408 Bird Game Project: 3 Kauj Ruam
Arduino Flappy Bird | Arduino 2.4 "TFT Touchscreen SPFD5408 Bird Game Project: Flappy Bird yog qhov kev ua si nrov dhau los nyob rau ob peb xyoos thiab ntau tus neeg tsim nws hauv thier tus kheej txoj kev yog li kuv, Kuv tsim kuv li version ntawm flappy noog nrog Arduino thiab pheej yig 2.4" TFT Touchscreen SPFD5408, Yog li cia peb pib ua
Kawm Yuav Ua Li Cas Kos Tus Tswm Ciab - Kauj Ruam Ib Kauj Ruam: 6 Kauj Ruam
Kawm Yuav Ua Li Cas Thiaj Li Tswmciab - Kauj Ruam Ib kauj ruam: Cov tswm ciab no siv sijhawm 10 feeb los kos yog tias koj ua raws kuv cov kauj ruam ua tib zoo