Build Tetris on an LED matrix lesson plan
Build a complete falling-blocks game on two 8x8 LED matrices: a field of sixteen bytes, seven pieces, quarter turns, line clears and levels.
Objectives and materials
By the end, students can
- Sixteen bytes on two matrices, and seven shapes that fall.
- Turn the pieces, clear the lines and speed it up.
- Put it all together into a game worth sharing.
Materials for the whole unit
- Arduino Uno R3
- Buzzer
- LED matrix, 8x8 x 2
- Thumb stick
Every part is already on the simulator’s bench, so there is nothing to buy or hand out. The counts are the most any one lesson uses, if you build it on real breadboards too.
The field and the pieces
Sixteen bytes on two matrices, and seven shapes that fall.
| Lesson | Time | What students do |
|---|---|---|
| The board gridTwo 8x8 LED matrices make one field 8 wide and 16 tall. Keep it as sixteen bytes, drive it over three wires, and draw on it with the joystick. | 45 min |
|
| PiecesThe seven shapes four squares can make, each a list of cells in a box. Make them fall, steer them, and stop them on the floor and on each other. | 50 min |
|
Materials
- Arduino Uno R3
- Buzzer
- LED matrix, 8x8 x 2
- Thumb stick
Check for understanding
Each student finishes "Pieces" on their own, without opening the hints. The simulator checks 6 of its 6 steps as they go.
Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Meet all seven".
The rules of the game
Turn the pieces, clear the lines and speed it up.
| Lesson | Time | What students do |
|---|---|---|
| RotationA quarter turn is a swap and a flip: (x, y) becomes (n - 1 - y, x). Turn every piece, find the one that never changes, and kick off the walls. | 50 min |
|
| Line clearsFind full rows with one comparison, pull everything above them down, and score more for more rows at once. Two puzzles, then free play. | 45 min |
|
| Speed levelsA level every 4 lines, each 15 percent faster, timed with millis() so the stick never feels sticky. Then the moment every game needs: game over. | 50 min |
|
Materials
- Arduino Uno R3
- Buzzer
- LED matrix, 8x8 x 2
- Thumb stick
Check for understanding
Each student finishes "Speed levels" on their own, without opening the hints. The simulator checks 6 of its 6 steps as they go.
Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Game over".
A pocket game
Put it all together into a game worth sharing.
| Lesson | Time | What students do |
|---|---|---|
| Project: a pocket falling-blocks gameThe whole game: a title screen, pieces from a shuffled bag, a lock click, pause, a best score, and it is yours to change and share. | 60 min |
|
Materials
- Arduino Uno R3
- Buzzer
- LED matrix, 8x8 x 2
- Thumb stick
Check for understanding
Each student finishes "Project: a pocket falling-blocks game" on their own, without opening the hints. The simulator checks 7 of its 7 steps as they go.
Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Make it yours".
Teach this unit as a class
Start a class from this course and its 6 lessons are assigned in one go, in order. Students join with a six-character code or printed login cards, and each one’s work comes back to you.
The class tools are free for 30 days for one class of up to 20 students, with no card. The lessons themselves are free either way.