A faithful recreation of the 1980 Atari arcade game Missile Command.
Defend cities from nuclear attack by firing counter-missiles (ABMs) from three silos. The game faithfully replicates the original arcade mechanics including:
- 60Hz game loop with IRQ-driven architecture
- Slot-based missile system (8 ABM, 8 ICBM, 1 flier, 20 explosions)
- Fixed-point 8.8 math for missile movement
- Octagonal explosions with 3/8 slope
- Smart bombs with evasive movement
- MIRV splitting logic
- Attack wave pacing and limitations
- Authentic scoring and bonus city system
- Python 3.8 or higher
- pygame 2.5.0 or higher
git clone https://github.com/CAG07/missile-command.git
cd missile-command
pip install -r requirements.txtpython missile-defense.py- 1: Start 1-player game
- P: Pause/Unpause
- ESC: Exit game
- Mouse Movement: Move crosshairs
- Left Button: Fire from left silo
- Middle Button: Fire from center silo
- Right Button: Fire from right silo
Defend your cities from incoming ICBMs, bombers, satellites, and smart bombs. The game ends when all cities are destroyed.
- 3 silos: Left, Center, Right
- 10 ABMs per silo (restored each wave)
- Center silo: Faster missiles (7 units/frame)
- Side silos: Slower missiles (3 units/frame)
- Maximum 8 ABMs in flight at once
| Target | Points |
|---|---|
| ICBM | 25 |
| Bomber/Satellite | 100 |
| Smart Bomb | 125 |
| Unfired ABM (wave end) | 5 |
| Surviving City (wave end) | 100 |
Scoring Multiplier: Increases every other wave (1x → 2x → 3x → 4x → 5x → 6x at wave 11+)
- Awarded every 10,000 points (default, configurable)
- Can accumulate up to 255 bonus cities
- Randomly placed when cities are destroyed
- Marathon Mode: 6 initial cities, bonus every 10K points
- Tournament Mode: 6 initial cities, no bonus cities
python missile-defense.py [OPTIONS]
Options:
--fullscreen Launch in fullscreen mode
--scale N Display scale multiplier (1-4, default: 2)
--debug Enable debug overlays
--attract Start in attract mode
--wave N Start at specific wave (testing)
--marathon Marathon mode (default)
--tournament Tournament mode (no bonus cities)
--help Show help messageBased on the original arcade hardware:
- CPU: 6502 running at ~1.25 MHz
- Display: 256x231 resolution
- Frame Rate: 60Hz
- IRQ Rate: 240Hz (4x per frame)
- Video RAM: 16KB (2bpp/3bpp hybrid)
- Sound: POKEY chip (4 channels)
ICBMs can split when:
- Current or previous missile at altitude 128-159
- No missile above altitude 159
- Available slots exist
- Splits into up to 3 additional missiles
New attacks don't launch while highest ICBM is above:
202 - (2 × wave_number), minimum 180
- Player never loses more than 3 cities per wave
- If 3+ cities destroyed and no ABMs, wave ends immediately
- Attack targeting adjusted to prevent excessive city loss
- Maximum 2 on screen at once
- Evade explosions by detecting flashing colors (#4/#5)
- Move toward target while avoiding explosions
- Count as 2 missiles in spawn calculations
- Shape: Octagonal (3/8 slope, not 1/2)
- Max Radius: 13 pixels
- Slots: 20 explosions in 5 groups of 4
- Update: 1 group per frame (reduces load)
- Collision: Checked every 5 frames, only affects ICBMs
- No collision below line 33
- Defers score redraw during heavy frames
- Group-based explosion updates
- Fixed-point math for efficiency
- Optimized rendering pipeline
missile-command/
├── src/
│ ├── config.py # Game configuration and constants
│ ├── game.py # Main game logic and state management
│ ├── models/
│ │ ├── missile.py # ABM, ICBM, SmartBomb, Flier classes
│ │ ├── explosion.py # Explosion system
│ │ ├── city.py # City and bonus management
│ │ └── defense.py # Silo management
│ ├── utils/
│ │ ├── functions.py # Math and utility functions
│ │ └── input_handler.py # Input processing
│ └── ui/
│ └── text.py # Text rendering and scrolling
├── data/
│ ├── fnt/ # Fonts
│ ├── img/ # Sprites and graphics
│ └── sfx/ # Sound effects
├── tests/ # Unit tests
├── missile-defense.py # Application entry point
├── requirements.txt # Python dependencies
└── README.md # This file
Run the test suite:
pytest tests/With coverage:
pytest --cov=src tests/python missile-defense.py --debugShows:
- FPS counter
- Slot occupancy (ABM, ICBM, Explosions)
- Frame timing
- Collision boxes
- Grid overlay
# Format code
black src/ tests/
# Lint
flake8 src/ tests/
# Type checking
mypy src/This implementation is based on the official Missile Command Disassembly (revision 3 ROMs):
- Title: Missile Command
- Developer: Atari, Inc.
- Year: 1980
- Platform: Arcade
- CPU: 6502
- Designer: Dave Theurer
- Attack wave logic:
$5791 - MIRV conditions:
$5379/$56d1 - Wave end check:
$59fa - Score deferral:
$50ff - Bonus city table:
$6082 - Initial city table:
$5b08
This recreation targets revision 3 behavior. Notable differences from revision 2:
- ✓ Fixed "810 bug" (176 bonus cities at 810K)
- ✓ Fixed wave 255/256 multiplier overflow
- ✓ Fixed attack pacing at wave 102+
This is a recreation for educational purposes. The original Missile Command is copyright 1980 Atari, Inc.
Contributions welcome! Please:
- Reference the disassembly documentation
- Add tests for new features
- Maintain 60Hz timing accuracy
- Follow existing code style
- Dave Theurer — Original game designer
- Andy McFadden — Disassembly documentation
- MAME Team — Emulation and preservation
- Atari — Original game
- Based on initial work by BekBrace
Defend your cities. Save humanity. Good luck, Commander.
