Skip to content

pineapple-pager-projects/pineapple_pager_space_invaders

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Space Invaders for WiFi Pineapple Pager

Classic Space Invaders arcade game for the WiFi Pineapple Pager.

Created by brAinphreAk | www.brainphreak.net

Space Invaders

Gameplay

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!

Scoring

  • Top row aliens (cyan): 30 points
  • Middle row aliens (magenta): 20 points
  • Bottom row aliens (green): 10 points
  • UFO (red): 100-300 points (random)

Controls

Button Action
LEFT Move ship left
RIGHT Move ship right
GREEN Fire
RED Pause menu

Note: The physical green button is BTN_B in code and the physical red button is BTN_A. The pager_gfx.h header has these labels inverted.

Installation

Quick Install (Pre-built Binary)

  1. Connect to your Pager via SSH:

    ssh root@172.16.52.1
  2. Create the game directory:

    mkdir -p /root/payloads/user/games/space_invaders
  3. 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/
  4. Make the files executable:

    ssh root@172.16.52.1 "chmod +x /root/payloads/user/games/space_invaders/*"
  5. The game will now appear in your Pager's Games menu!

Build from Source

Prerequisites

  • 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.

Compile

# 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 to Pager

# Deploy via SSH (Pager connected via USB)
make deploy

# Or specify a different IP
make deploy PAGER_IP=192.168.1.100

Project Structure

pineapple_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

Features

  • 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

How It Was Made

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

Hardware

  • 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

License

MIT License


Created by brAinphreAk

About

Space Invaders clone for the hak5 pineapple pager

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

 
 
 

Contributors