A from-scratch Space Invaders starter built with Pygame APIs.
python3 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
python -m pip install --upgrade pip setuptools wheel
pip install -r requirements.txt
python main.pyIf pip install pygame tries to compile from source and fails with SDL.h file not found, use these steps:
- Use Python 3.12 (3.13 may not have wheels for all pygame builds yet).
- Upgrade pip/setuptools/wheel in your venv.
- Install from
requirements.txt(this project now usespygame-ce, which ships prebuilt wheels on macOS more reliably).
Example:
brew install python@3.12
python3.12 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip setuptools wheel
pip install -r requirements.txt
python main.py- Move:
A/DorLeft/Right - Shoot:
Space - Start game:
Enter(orSpaceon start screen) - Pause/resume:
P - Restart after win/lose:
R - Quit:
Esc
- Smoothed player acceleration/deceleration for tighter movement feel
- Gentler per-wave speed scaling so progression stays beatable
- Invader firing from bottom-most survivors in each column (classic behavior)
- Destructible bunkers and pixel-style sprites inspired by original Space Invaders silhouettes
- Animated invader sprite frames + bonus UFO target worth extra points
- Explosion particle effects on alien/UFO/player hits
- Wave progression (
3waves to win), plus score/lives/high-score HUD - Persistent local high score saved to
high_score.json - Start / pause / win / lose states and restart flow