A four-against-four tank battle for the Macintosh 512K. Scrolling battlefield, four weapons, computer tanks that flank, take cover and drive home to repair, sampled sound, 20 frames per second.
- Made for
- Macintosh 512K (64K ROM), System 3.2
- Written in
- 68000 assembler: 6,410 lines in 11 modules
- Size
- 15 KB of code, 199 KB of graphics, maps and sound in a data file
- Speed
- 20 frames per second on a Mac 512K
- Built with
- mac68k-asm and mac68k-disk
- Year
- 2026
- Runs on
- Macintosh 512K, 512Ke or Plus; System 3.2 or later; 400K floppy
You drive one white tank; three computer tanks fight on your side against four black ones. The first team to lose 20 tanks loses the battle.
- Shield and armour. The shield takes hits first. Your base repairs you, recharges the shield and refills your ammunition. Destroyed tanks return to their base after ten seconds.
- Terrain. Rivers and lakes stop tanks but not shells. Walls stop shells and can be shot to rubble. Forests hide you: a tank in a forest is seen only from close by, or for a moment after it fires. Cannon shells and rockets burst in the trees and clear them; the forest grows back in the next round.
- Computer tanks. Each one has a role (north, middle or south bridge, and a flank). They circle their targets, take cover when hurt, drop mines when chased, and drive home to repair.
How it was made
Tank Duel was written by Claude Code, Anthropic’s coding agent, from three prompts, with mac68k-asm, mac68k-disk and the Mini vMac emulator, in which it tested every step itself. The movie shows how.
Under the hood: page flipping between the two screen buffers of the 512K at 20 frames per second, 16×16 tiles pre-shifted into 16 positions, tanks in 32 directions rendered 8× supersampled in Python, a three-channel sound mixer (engine and two effects) filling the sound buffer in every vertical blank, a waypoint graph for the computer tanks, and a radar at one pixel per tile.
| Key | Action |
|---|---|
| W / S | drive forward / back |
| A / D | turn the hull |
| Mouse | aim the turret (the camera leans towards the crosshair) |
| Mouse button | fire (hold it for the machine gun) |
| 1 2 3 4 | cannon, machine gun, homing rockets, mines |
| P | pause |
| C | while destroyed: watch the other tanks |
| Command-Q | quit to the Finder |
Screenshots from Mini vMac at the real speed of the machine.
The video is loaded from YouTube (youtube-nocookie.com) only when you press Play.
Vibe Coding a 1984 Mac Game in 68000 Assembler with Claude Code: Claude Code writes Tank Duel, a four-against-four tank battle for the Macintosh 512K, in 68000 assembler, from three prompts, and tests every step itself in the emulator.
tank-duel.dsk : 400K MFS startup floppy "Tank Duel" with System 3.2, Finder 5.3, Tank Duel and its data file "Tank Duel Data" (the two must stay together); it boots straight into the game, the same disk as in the emulator.
Use it with a floppy emulator or a disk writer on a real Mac, or start it in Mini vMac or any other emulator of the first Macs.