Cov txheej txheem:

LCD Invaders: Qhov Chaw Invaders Zoo Li Kev Ua Si ntawm 16x2 LCD Cov Cim Cim: 7 Kauj Ruam
LCD Invaders: Qhov Chaw Invaders Zoo Li Kev Ua Si ntawm 16x2 LCD Cov Cim Cim: 7 Kauj Ruam

Video: LCD Invaders: Qhov Chaw Invaders Zoo Li Kev Ua Si ntawm 16x2 LCD Cov Cim Cim: 7 Kauj Ruam

Video: LCD Invaders: Qhov Chaw Invaders Zoo Li Kev Ua Si ntawm 16x2 LCD Cov Cim Cim: 7 Kauj Ruam
Video: Никто не может сражаться! Российский танк-монстр уничтожил украинскую гавань в Одессе - ARMA 3 2024, Hlis ntuj nqeg
Anonim
LCD Invaders: Qhov Chaw Invaders Zoo Li Kev Ua Si ntawm 16x2 LCD Cov Cim Cim
LCD Invaders: Qhov Chaw Invaders Zoo Li Kev Ua Si ntawm 16x2 LCD Cov Cim Cim
LCD Invaders: Qhov Chaw Invaders Zoo Li Kev Ua Si ntawm 16x2 LCD Cov Cim Cim
LCD Invaders: Qhov Chaw Invaders Zoo Li Kev Ua Si ntawm 16x2 LCD Cov Cim Cim
LCD Invaders: Qhov Chaw Invaders Zoo Li Kev Ua Si ntawm 16x2 LCD Cov Cim Cim
LCD Invaders: Qhov Chaw Invaders Zoo Li Kev Ua Si ntawm 16x2 LCD Cov Cim Cim
LCD Invaders: Qhov Chaw Invaders Zoo Li Kev Ua Si ntawm 16x2 LCD Cov Cim Cim
LCD Invaders: Qhov Chaw Invaders Zoo Li Kev Ua Si ntawm 16x2 LCD Cov Cim Cim

Tsis tas yuav tsum qhia cov lus dab neeg "Space Invaders" game. Qhov tshwj xeeb tshaj plaws ntawm qhov haujlwm no yog tias nws siv cov ntawv nyeem rau cov duab tso tawm. Nws ua tiav los ntawm kev ua 8 tus cim kev cai.

Koj tuaj yeem rub tawm daim duab tiav Arduino ntawm no:

github.com/arduinocelentano/LCD_invaders/

Khoom siv

Arduino UNO pawg thawj coj saib

LCD keypad tiv thaiv

USB cable rau kos duab uploading

Kauj Ruam 1: Tsim Game

Game Tsim
Game Tsim

Lub vijtsam tsis tso cai tswj cais cov pixels thiab muab tsuas yog ob kab ntawv uas tsis txaus rau kev ua si. Tab sis nws tso cai rau siv txog li 8 tus cim kev cai. Qhov ua kom yuam kev yog ua txhua tus 5x8 pixels cim ua ob 5x4 pixels game cells. Ntawd yog hais, peb yuav muaj 16x4 qhov chaw ua si, uas ua rau muaj kev nkag siab. 8 tus cim tsuas yog txaus los siv sprites rau cov neeg ua si lub dav hlau, cov mos txwv thiab cov neeg txawv teb chaws ua yeeb yam. Txij li cov sprites yog 5x4 thiab cov cim yog 5x8, peb yuav xav tau qee tus cim nrog ob tus sprites zoo li "lub dav hlau thiab lub mos txwv" sprite, "tus neeg txawv teb chaws thiab tus mos txwv sprite" thiab lwm yam.

Kauj Ruam 2: Ua Ntej

Ua Ntej
Ua Ntej

Feem ntau, tag nrho cov nyees khawm ntawm daim iav thaiv LCD tau txuas nrog tib tus pin analog. Muaj ntau qhov sib txawv ntawm LCD ntaub thaiv npog, yog li koj yuav zaum yuav tsum tau hloov me ntsis cov ntsiab lus hauv kuv lub khawm ua cov cai.

Kauj Ruam 3: Hierarchy Chav Kawm

Cov Hierarchy
Cov Hierarchy

Kuv tau ua tiav chav kawm hauv paus GameObject uas muaj kev tswj hwm thiab ua haujlwm nrawm thiab txheej txheem kev sib tsoo. Classes Ship, Alien thiab Bullet tau txais los ntawm nws.

Kauj Ruam 4: Hloov Kho Lub Vev Xaib

Hloov Kho Cov Vijtsam
Hloov Kho Cov Vijtsam

Rendering logic yuav zoo li nyuab me ntsis vim tias peb yuav tsum hloov pauv 16x4 game logic rau hauv 16x2 zaub. Thov nyeem cov lus hauv kab lus rau kev siv ntxiv. Txhawm rau zam kev yoo mov, Kuv tau siv ob txoj kab sib txawv ua kab ntawv ua kab ntawv. Nws tso cai siv ob peb (ib qho rau txhua kab) ntawm kev ua haujlwm luam ntawv los hloov kho lub vijtsam.

Kauj Ruam 5: Game Logic

Game Logic
Game Logic

Nov yog lub plawv ntawm qhov kev ua si. Lub voj loj hloov pauv kev tswj hwm ntawm txhua yam khoom, tshuaj xyuas txhua yam kev sib tsoo thiab khawm cov xwm txheej. Kev ceev ntawm cov neeg txawv teb chaws thiab lawv qhov kev tshwm sim tua nce ntxiv los ntawm qib mus rau qib. Tab sis cov qhab nia khoom plig nce ntxiv ib yam.

Kauj Ruam 6: Easter Egg

Ib Qe Easter
Ib Qe Easter

Tsis muaj qib tom qab qib 42. Tiag tiag. Nws yog Qib Kawg ntawm Lub Neej, Lub Ntiaj Teb, thiab Txhua Yam.:)

Pom zoo: