Classic Space Invaders arcade game for the WiFi Pineapple Pager.
Created by brAinphreAk | www.brainphreak.net
Defend Earth from waves of descending alien invaders! Move your ship left and right, fire at the aliens, and use shields for cover. Don't let them reach the bottom!
- Top row aliens (cyan): 30 points
- Middle row aliens (magenta): 20 points
- Bottom row aliens (green): 10 points
- UFO (red): 100-300 points (random)
| Button | Action |
|---|---|
| LEFT | Move ship left |
| RIGHT | Move ship right |
| GREEN | Fire |
| RED | Pause menu |
Note: The physical green button is
BTN_Bin code and the physical red button isBTN_A. The pager_gfx.h header has these labels inverted.
-
Connect to your Pager via SSH:
ssh root@172.16.52.1
-
Create the game directory:
mkdir -p /root/payloads/user/games/space_invaders
-
Copy the files from
payloads/user/games/space_invaders/to your Pager:scp payloads/user/games/space_invaders/* root@172.16.52.1:/root/payloads/user/games/space_invaders/ -
Make the files executable:
ssh root@172.16.52.1 "chmod +x /root/payloads/user/games/space_invaders/*" -
The game will now appear in your Pager's Games menu!
- MIPS cross-compiler:
mipsel-openwrt-linux-musl-gcc - Standard build tools (make)
You can obtain the cross-compiler from the OpenWrt SDK for the ramips/mt76x8 target.
# Cross-compile for Pager
make CROSS_COMPILE=mipsel-openwrt-linux-musl- invaders
# Or compile natively for testing (won't run on Pager)
make invaders# Deploy via SSH (Pager connected via USB)
make deploy
# Or specify a different IP
make deploy PAGER_IP=192.168.1.100pineapple_pager_space_invaders/
├── src/
│ ├── lib/
│ │ ├── pager_gfx.h # Graphics library header
│ │ └── pager_gfx.c # Graphics library implementation
│ └── invaders/
│ └── invaders.c # Main game source
├── payloads/user/games/space_invaders/
│ ├── payload.sh # Pager payload entry point
│ └── invaders # Compiled binary (after build)
├── screenshots/ # Game screenshots
├── Makefile # Build configuration
├── .gitignore
└── README.md
- 5 rows x 11 columns of aliens (55 total)
- 3 alien types with different colors and point values
- 4 destructible shields with pixel-by-pixel erosion
- Aliens destroy shields on contact as they descend
- Mystery UFO that appears periodically
- Progressive difficulty (faster aliens as you kill them, lower starting position each level)
- High score persistence (saved to
/root/loot/invaders_highscore) - Sound effects via RTTTL buzzer
- LED effects for firing, kills, and game events
- Player invincibility frames after being hit
- Smooth 20 FPS gameplay
This game was built using the WiFi Pineapple Pager's graphics library (pager_gfx), which provides:
- Direct framebuffer access for fast rendering
- Input handling for the D-pad and A/B buttons
- RTTTL audio playback through the buzzer
- LED control for visual feedback
The game renders in landscape mode (480x222) using 90-degree rotation. All sprites are drawn procedurally using filled rectangles - no external image assets required.
Key implementation details:
- Aliens speed up as you destroy them (classic Space Invaders mechanic)
- Shields use a bitmap for pixel-perfect destruction
- Collision detection handles bullets, aliens, shields, and the player
- Game state persists high scores to the filesystem
- Display: 222x480 (used in landscape: 480x222)
- Input: D-pad + A/B buttons
- Audio: Buzzer with RTTTL support
- LEDs: RGB D-pad LEDs + A/B button LEDs
MIT License
Created by brAinphreAk
