ExperimentsFable 5.2 Retro Games
Parchment Siege
The game has the keyboard when this page opens. If the keys stop working, click or tap the game. On a phone, Play full screen gives the game the whole screen.
Build notes
Open NOTES.md ↗ (opens in a new tab)- Original title: Parchment Siege
- Inspired by: the Space Invaders genre (a marching formation, a player at the bottom, shields)
- File:
games/01-parchment-siege/index.html(one self-contained file, no network requests) - Built by: Job A, 2026-11-14
What I built
A formation of 40 creatures marches down the page in steps. The formation gets faster as it gets smaller. You move a ballista along the ground and shoot quills. Three brick walls protect you and crumble where they are hit. You have three lives. Each new wave starts lower and faster.
Additions to the genre:
- Streak multiplier. Hits in a row without a miss raise the score multiplier, up to ×5. A quill that leaves the top of the page resets it.
- Comet wyrm. A flyer crosses the top of the page from time to time. Hit it for 150 points and 8 seconds of triple shots.
- Three kinds of enemy shot. The moths in the top row drop shots that weave from side to side.
- Hold to steer. On a touch screen you can hold a finger on the page; the ballista follows it and fires.
Looks
- Woodcut (main). Black ink on yellowed parchment. Each creature is a black silhouette with white lines carved out of it, like a woodcut print. The page has stains, fibres, a burnt edge, a faint printed sun, and a hand-wobbled double border.
- Lantern Night. A night festival: the creatures become glowing paper lanterns and lantern fish that bob on the air, over a moon, hills, pagoda roofs, and water. You are a small lit boat.
- Riso Print. A two-colour print-shop look: flat pink, yellow, and teal shapes with halftone dots and a navy line layer printed slightly out of register.
Techniques
- All art is drawn by code on a canvas. There are no image files.
- Creature shapes are paths. The woodcut effect draws the black shape, then removes thin lines and eyes from it with the
destination-outblend mode, so the parchment shows through the cuts. - In the Woodcut look, ink splatter from each kill is stamped onto a second layer that stays for the rest of the game. The page gets dirtier as you play.
- Sprites and backgrounds are drawn once at the screen's pixel density and reused, so the game stays sharp and fast on phones.
- Sound is generated with the Web Audio API: a four-note march, quill shots, splats, and a warble for the wyrm.
What I am proud of
The carved woodcut creatures, and the ink stains that build up on the parchment during a game. The three looks do not share a mood: an old book, a festival night, and a print shop.
Known issues
- On a phone held sideways the playfield is small (about 228x305 CSS pixels on a 740x360 screen), because the page is tall. It is playable, but portrait is better.
- The Woodcut look uses the Luminari font when the device has it (macOS). Other devices fall back to another serif font.
- Ink stains are cleared when the window is resized or the look is changed.
Self-test
Tested with headless Chrome through .tools/selftest.js at 375x667, 740x360, and 1440x900. Result: all checks passed (no console errors, no network requests, start screen, start, pause, resume, restart, three looks, buttons and touch pads inside the screen).
Issues found and fixed during testing:
- The page behind the playfield stayed white in the Lantern Night and Riso Print looks. The colour variables were on the wrong element. Fixed.
- When the creatures reached the bottom, the game did not end. The "player lost" timer was restarted on every march step. Fixed, and confirmed with a scripted test.
- The look name was cut off in the top bar on a 375-pixel phone. The look button is now wider than the other three.
- The start card was squeezed inside the narrow playfield on a phone held sideways. The card now uses the whole stage area.

