# Pygame Space Invaders

> Classic Space Invaders game prototype built with Pygame. Use when asked to play Space Invaders, test the Space Invaders game, or debug game logic. Supports formation movement, player shooting, alien shooting, increasing difficulty, and score tracking.

- Skill: `fnaith/pygame-space-invaders` (Agent Skill, multi-file: 4 files)
- Install (CLI): `npx skillmds@latest add fnaith/pygame-space-invaders`
- Raw SKILL.md: https://api.skillmd.com/api/skills/fnaith/pygame-space-invaders/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: fnaith (https://skillmd.com/u/fnaith)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/fnaith/pygame-space-invaders

---


# Pygame Space Invaders

A minimal Space Invaders game prototype built with Pygame.

## When to Use

- Play a game of Space Invaders
- Test or debug the Space Invaders game logic
- Verify game rules: formation movement, shooting, increasing difficulty

## Prerequisites

- Python 3.10+
- Pygame (see requirements.txt)

## Usage

```
python pygame-space-invaders.py [--width N] [--height N] [--fps N] [--alien-speed N]
```

### Options

| Option | Default | Description |
|--------|---------|-------------|
| `--width` | 800 | Window width in pixels |
| `--height` | 600 | Window height in pixels |
| `--fps` | 60 | Frame rate |
| `--alien-speed` | 2.0 | Alien movement base speed |

### Controls

- **Left/Right arrows or A/D**: Move player
- **Space**: Shoot
- **R key**: Restart after game over
- **ESC / Close window**: Exit

## Game Rules

- Player moves left/right at the bottom of the screen
- Aliens move in formation, stepping down when reaching screen edges
- Shooting an alien destroys it and increases score
- Aliens randomly shoot back at the player
- Alien movement speed increases as more aliens are destroyed
- Clearing all aliens advances to the next level with increased difficulty
- Losing all 3 lives ends the game

