Artillery Duel: Love letter to Scorched Earth and test of Claude
A simple game of artillery pieces fighting each other in a web browser, with “hot seat” multiplayer. Play the game or check out the source code on GitHub.
Disclaimer: This game was made with Claude Opus 5.5 Medium.
1. Personal history
When I was still in single digits and we did not have a computer at home (it was the early nineties, so nothing unusual), I had to find other ways to get computer access: the computer club at the local “DDM” [House of Children and Youth, something like the YMCA without the religious aspect], one (yes, one!) school computer, and the work computers of family friends. It was usually some 286 or 386 machine, but in one case it was different. My classmate’s older brother had it all: a knife collection, a girlfriend and, the pièce de résistance, a 486DX2! He was the coolest person I knew.
And not just a computer, it was full of games! I remember he even had an original copy of Command & Conquer. That was absolutely unheard of: piracy at the time was endemic and legal software was as rare as pink diamonds. Anyway, one of the games he had was Scorched Earth. It interested me because of its minimalistic graphics, easy yet challenging gameplay and good premise. Artillery guns shooting at each other until only one side stands, it was fun!
A few years later, in 1995, Worms was released and Scorched Earth was promptly forgotten.
To commemorate good ol’ Scorched Earth and try out Claude, I made a spiritual successor to it! The idea was sparked by Pin-a-Blaster and Shatteroids. So I went ahead and, 100k tokens later, et voilà! We have a working prototype!
2. Gameplay
You can either play the game on my github.io page, or download it from the GitHub repository and run it locally with these commands (you need Git and Python 3):
1
2
3
git clone https://github.com/zdenekru/artillery-duel.git
cd artillery-duel
bash tools/serve.sh
and then open http://127.0.0.1:8000/ in your browser.
Either way, you are welcomed by the home screen:
And you can immediately switch to the monochromatic War Games style:
The gameplay is the same; you just need to tell the players apart by their number instead of their colour.
The game itself is pretty straightforward. Use the Left and Right arrow keys to change the elevation, Up and Down to change the power, and fire with the Spacebar. Number keys change the type of ammunition, and “A” and “D” move your rovers (but not your static gun posts).
At any time you can press “H” for the help overlay, or “G” to switch between the pixel art and monochromatic styles. Esc pauses the game.
3. Technical details
JavaScript and web
- Plain JavaScript loaded straight by the browser. No framework, no game engine, no npm and no build step.
- Size: about 3,050 lines of JavaScript in 11 files, plus a 2,000-line test suite. The whole game is about 36 KB compressed.
- No image or sound files. Units, fonts and sounds are all generated in code:
- Units are tiny drawings stored as text.
- The pixel font is home-made, 5×7 pixels per letter.
- Sounds are synthesised with the browser’s built-in audio API.
- Drawing: one HTML5 canvas at 640×360, scaled up to the window with sharp pixels.
- Destructible terrain: every pixel of ground is stored as one byte. Explosions cut out circles, and loose dirt then falls one pixel per step. Only the changed columns are redrawn.
- Fixed-speed physics: the game updates exactly 60 times a second whatever the screen’s refresh rate, so it plays the same on any computer.
- Same map, same game: maps and randomness come from a seed number. Entering the same seed rebuilds the same map, which makes bugs reproducible.
- Computer players: they simulate dozens of candidate shots with the same physics code as real shots. They pick the best one, then add deliberate error: Easy is sloppy and only half accounts for wind, Hard is nearly exact. The search runs in slices of about 6 ms per frame so the game never stutters.
- War Games mode is done in the drawing step:
- The frame is turned grey, then tinted green.
- Mixing in part of the previous frame leaves a fading glow behind moving things.
- A blurred copy is added on top for bloom.
- The scanlines and darkened edges are a CSS layer over the canvas.
- Saved settings: settings, mute and graphics mode are stored in the browser (localStorage). There’s no server and no tracking.
Happy shooting!



