Matrix Project homework for the Introduction to Robotics course (2025–2026)
Author: GEORGE VERYKAKIS
An Arduino-based Space Invaders game developed for the Introduction to Robotics – Matrix Project.
The game runs on an 8×8 LED matrix (MAX7219) with an LCD menu system, joystick controls, sound effects, levels, and a boss fight with a countdown timer.
A retro Space Invaders–style game built using:
- 8×8 LED Matrix (MAX7219)
- LCD 16×2 display
- Joystick (X, Y, SW)
- Arduino UNO/Nano
- Optional buzzer
- EEPROM for saving settings & highscore
- Optional Ultrasonic sensor for dynamic speed
- Beautiful home menu (Start, Highscore, Settings, About)
- Player movement with joystick
- Shooting mechanic (joystick press)
- Falling or horizontal enemies
- Increasing difficulty & levels
- Score system + saved highscore in EEPROM
- Adjustable LCD & Matrix brightness
- Sound on/off setting
- Smooth animations
- Ultrasonic sensor increases speed when hand is close
- Control a spaceship at the bottom of an 8×8 LED matrix
- Move left and right using a joystick
- Shoot bullets to destroy incoming enemies
- Enemies move faster as levels increase
- A Mother Ship (boss) appears after enough enemies pass
- You must destroy the boss within 15 seconds or you lose
- Joystick Left / Right – Move player
- Joystick Button – Shoot
- Joystick in Menu – Navigate options
Navigated using the joystick and displayed on a 16×2 LCD:
- Start – Begin a new game
- Highscore – Shows best score + player name (stored in EEPROM)
- About – Game and author information
The menu is stable and only moves when the joystick is intentionally pushed.
- Appears after a number of enemies pass the player
- Moves horizontally across the top row
- Has multiple hit points
- A 15-second countdown timer is shown on the LCD
- If the timer reaches 0 → Game Over
- Destroying it gives bonus points and plays a sound effect
The game uses millis() instead of delay() for:
- Enemy movement
- Player movement
- Bullet updates
- Boss movement
- Boss countdown timer
This allows smooth gameplay without freezing the Arduino loop.
- Highscore is saved in EEPROM
- When beaten, the player enters a 3-letter name using the joystick
- Name and score persist even after power loss
A buzzer provides audio feedback for:
- Shooting
- Enemy hits
- Level up
- Mother Ship appearance
- Mother Ship destruction
- Game over
- Score increases by destroying enemies
- Every few points → level increases
- Enemy speed increases with each level
- Boss fights increase difficulty and pressure
| Matrix Pin | Arduino |
|---|---|
| VCC | 5V |
| GND | GND |
| DIN | 12 |
| CS | 10 |
| CLK | 11 |
| Joystick Pin | Arduino |
|---|---|
| VRX | A0 |
| VRY | A1 |
| SW | D2 |
| LCD Pin | Arduino |
|---|---|
| RS | 9 |
| EN | 8 |
| D4 | 7 |
| D5 | 6 |
| D6 | 5 |
| D7 | 4 |
| Buzzer | Arduino |
|---|---|
| + | D3 |
| – | GND |
| Sensor Pin | Arduino |
|---|---|
| TRIG | A2 |
| ECHO | A3 |
- Open Arduino IDE.
- Install these libraries:
- LedControl
- LiquidCrystal
- EEPROM (built-in)
- Open
Final_Matrix_Project.inoinsrc/ - Upload to Arduino UNO/Nano
- Final_Matrix_Project.ino: Main sketch, initializes hardware, handles menu and game loop.
- menu.h: Menu display, joystick navigation, About screen.
- game.h: Gameplay logic: movement, shooting, enemy spawning, collisions, score, levels.
- settings.h: Adjust LCD/matrix brightness, sound settings, save to EEPROM.
- matrix.h: LED drawing helpers, sprite updates, clear matrix.
- utils.h: Utility functions for general purpose.
- Animated splash screen
- Multiple enemy types
- Boss fight
- Sound effects pack

