Arcade in a PDF
A complete falling-block arcade loop that runs inside a PDF viewer, with a driver that can start, place and clear.
This is a browser game spec on Spekkr, published by nova. It is listed with the other specs. Paste the line to an agent that can open a web address, and the agent fetches the files and builds from them.
- Spec
nova/pdf-arcade- Version
- 0.2.2
- Published by
- nova
- Updated
- 15 Nov 2026
Build this spec
Build the spec at https://spekkr.com/nova/pdf-arcade/start.md.
Paste this to your AI agent. It opens the address, fetches the spec's files, records your choices and builds from them. Nothing to install, no account.
Published by nova.
What does the result look like?
What can I customize?
Your choices go into the line you copy. Anything else is yours to edit, but it leaves the tested path.
What do I get?
-
spec.mdRequirements and acceptance checks.Arcade in a PDF
What this builds
A one-page PDF that is also a game: pieces fall in a well, the person rotates and slides them with buttons or keys the viewer supports, and a full line disappears. The hook is the format. The piece shapes and the art are original. A test driver talks to the PDF (or to the same script the PDF embeds) and can start a game, place a piece, and clear a line without a person present.
Read
spekkr.inputs.jsonfirst.titleis drawn on the first page.widthandheightsize the well.setchooses the shapes.next_pieceandghostadd previews.Out of scope
- A copyrighted piece set or someone else's art.
- A multi-page story or a PDF that needs a paid viewer plug-in.
- Network, accounts or a score server.
Requirements
Each requirement has an id. Checks name the id they cover.
R1. The page
- The file is a valid PDF. Opening it shows one page with the well, the title, a score, and the controls.
- The well is
widthbyheightcells. Each cell is square. - The same file plays in a scriptable viewer used by the tests.
Accept when: a tool reports a single page, and a rendered first page matches
first-pagewithin the tolerance indesign.md.R2. Pieces
- The
sevenset has the seven shapes indesign.md, each a set of four cells. Thefiveset is the first five of those. - A bag randomiser, seeded, deals the set without a repeat until the bag is empty.
- Rotate is 90 degrees about the documented origin. Wall kicks follow the small table in
design.md.
Accept when: unit tests place, rotate and kick every shape as in the table, and a seeded bag of 14
sevenpieces contains each shape twice.R3. A driven game
- The driver can start a game with the seed in
design.md, spawn a documented first piece, slide it, rotate it, and hard-drop it. - The fixture in
design.mdfills one line, clears it, adds 100 to the score, and leaves the well as in the after-clear grid. - The same script is what the PDF embeds, so the driver and the file do not drift.
Accept when: the driver starts a game, places the fixture piece, clears a line, and reads score 100 and the after-clear grid.
R4. Screenshots and files
- Frames are rendered from the PDF or from the same renderer: first-page at spawn, piece-falling mid-drop, line-clear on the flash frame, after-lock after the clear.
- One command builds the PDF, runs the driver, and writes the frames. No network.
Accept when: the command passes for both piece sets, and the frames match the goldens.
R5. Inputs
- The build reads
spekkr.inputs.json. Settings label the UI, options turn features on or off, and a swap must be one of its choices. - A value outside a stated range, or a swap that is not one of its choices, is refused before the app starts its checks, with a message that names the key.
Accept when: the default inputs render, an illegal swap is refused by name, and changing a visible setting (for example the title) shows up in a later check.
Verification
An automated driver (or the embedded script under a test harness) starts a game, places a piece, and clears a line. The first page and three later frames are rendered and checked against goldens. The piece set and art are original. No network and no paid viewer.
Definition of done
- Every acceptance check above runs from one command, and all pass at the person's inputs.
- A README says how to open the PDF, how to run the driver, and how to change the well size.
# Arcade in a PDF ## What this builds A one-page PDF that is also a game: pieces fall in a well, the person rotates and slides them with buttons or keys the viewer supports, and a full line disappears. The hook is the format. The piece shapes and the art are original. A test driver talks to the PDF (or to the same script the PDF embeds) and can start a game, place a piece, and clear a line without a person present. Read `spekkr.inputs.json` first. `title` is drawn on the first page. `width` and `height` size the well. `set` chooses the shapes. `next_piece` and `ghost` add previews. ## Out of scope - A copyrighted piece set or someone else's art. - A multi-page story or a PDF that needs a paid viewer plug-in. - Network, accounts or a score server. ## Requirements Each requirement has an id. Checks name the id they cover. ### R1. The page - The file is a valid PDF. Opening it shows one page with the well, the title, a score, and the controls. - The well is `width` by `height` cells. Each cell is square. - The same file plays in a scriptable viewer used by the tests. Accept when: a tool reports a single page, and a rendered first page matches `first-page` within the tolerance in `design.md`. ### R2. Pieces - The `seven` set has the seven shapes in `design.md`, each a set of four cells. The `five` set is the first five of those. - A bag randomiser, seeded, deals the set without a repeat until the bag is empty. - Rotate is 90 degrees about the documented origin. Wall kicks follow the small table in `design.md`. Accept when: unit tests place, rotate and kick every shape as in the table, and a seeded bag of 14 `seven` pieces contains each shape twice. ### R3. A driven game - The driver can start a game with the seed in `design.md`, spawn a documented first piece, slide it, rotate it, and hard-drop it. - The fixture in `design.md` fills one line, clears it, adds 100 to the score, and leaves the well as in the after-clear grid. - The same script is what the PDF embeds, so the driver and the file do not drift. Accept when: the driver starts a game, places the fixture piece, clears a line, and reads score 100 and the after-clear grid. ### R4. Screenshots and files - Frames are rendered from the PDF or from the same renderer: first-page at spawn, piece-falling mid-drop, line-clear on the flash frame, after-lock after the clear. - One command builds the PDF, runs the driver, and writes the frames. No network. Accept when: the command passes for both piece sets, and the frames match the goldens. ### R5. Inputs - The build reads `spekkr.inputs.json`. Settings label the UI, options turn features on or off, and a swap must be one of its choices. - A value outside a stated range, or a swap that is not one of its choices, is refused before the app starts its checks, with a message that names the key. Accept when: the default inputs render, an illegal swap is refused by name, and changing a visible setting (for example the title) shows up in a later check. ## Verification An automated driver (or the embedded script under a test harness) starts a game, places a piece, and clears a line. The first page and three later frames are rendered and checked against goldens. The piece set and art are original. No network and no paid viewer. ## Definition of done - Every acceptance check above runs from one command, and all pass at the person's inputs. - A README says how to open the PDF, how to run the driver, and how to change the well size.
-
design.mdPiece shapes, kicks, and the driver fixture that clears a line.Design
This file fixes the parts that are easy to get wrong. The language and tools are up to you, as long as the numbers here hold.
Piece set (
seven)Shapes are listed as cell offsets from an origin, then rotated 90 degrees clockwise about that origin.
The exact cells are
fixtures/pieces.json. Thefiveset is idsI,O,T,L,Jfrom that file. The remaining two ids areSandZ.Wall kicks: try the rotate in place, then 1 cell left, then 1 cell right. If none fit, the rotate does not happen.
Line-clear fixture
Seed 7,
sevenset, well 10 by 20. The driver commands arefixtures/pdf-clear.json. After they run, row 0 (the bottom) is cleared, the score is 100, and the well matchesfixtures/pdf-after-clear.txt.Screenshot tolerance
Each channel within 8 levels, 98% of pixels, page rendered at 1600 by 1000.
Inputs
Key Label Default Notes titleTitle on the page Blocks in a page Shown above the well. widthWell width in cells 10 From 6 to 12. heightWell height in cells 20 From 12 to 24. next_pieceShow the next piece on A small preview beside the well. ghostShow a landing ghost on A faint copy where the piece would land. setPiece set seven seven is the ordinary five-and-two set of shapes. five is a shorter set for a quicker demo. Acceptance at the defaults
The numbers, names and fixture paths already in this file are the authority. Where a later table or a shipped fixture file disagrees with prose, the table or the fixture wins.
Fixture Role design.mdA shipped fixture. The build may move it, but then design.mdmust name the new path.fixtures/pdf-after-clear.txtA shipped fixture. The build may move it, but then design.mdmust name the new path.fixtures/pdf-clear.jsonA shipped fixture. The build may move it, but then design.mdmust name the new path.fixtures/pieces.jsonA shipped fixture. The build may move it, but then design.mdmust name the new path.spekkr.inputs.jsonA shipped fixture. The build may move it, but then design.mdmust name the new path.Golden frames are compared at 1400 by 1000 CSS pixels unless a requirement names another size. Tolerance, unless a tighter figure is given above: 8 levels, 98% of pixels, with motion, cursors and clocks frozen as this file says. A build's goldens are of that build; they do not have to match a shipped reference preview pixel-for-pixel if the tool or the type is different, but they do have to match this file's layout, counts and copy.
Screenshots
These pictures are headless-Chrome captures of the working reference in
reference/preview.html, at the default inputs. They are not drawings of a product that has not been built. The first picture is the one Spekkr shows on the spec's card. A build may ship its own goldens; those goldens are of that build and do not have to match these frames pixel-for-pixel.File What it shows shots/page.pngA falling-block loop mid-game, drawn inside a document page. How to verify
- Run the checks at the default inputs, without a network.
- Walk through the scripted playthroughs, fixture lookups or goldens named in the requirements; each must match this file.
- Repeat once at the person's inputs when they differ from the defaults.
- An automated driver (or the embedded script under a test harness) starts a game, places a piece, and clears a line. The first page and three later frames are rendered and checked against goldens. The piece set and art are original. No network and no paid viewer.
# Design This file fixes the parts that are easy to get wrong. The language and tools are up to you, as long as the numbers here hold. ## Piece set (`seven`) Shapes are listed as cell offsets from an origin, then rotated 90 degrees clockwise about that origin. The exact cells are `fixtures/pieces.json`. The `five` set is ids `I`, `O`, `T`, `L`, `J` from that file. The remaining two ids are `S` and `Z`. Wall kicks: try the rotate in place, then 1 cell left, then 1 cell right. If none fit, the rotate does not happen. ## Line-clear fixture Seed 7, `seven` set, well 10 by 20. The driver commands are `fixtures/pdf-clear.json`. After they run, row 0 (the bottom) is cleared, the score is 100, and the well matches `fixtures/pdf-after-clear.txt`. ## Screenshot tolerance Each channel within 8 levels, 98% of pixels, page rendered at 1600 by 1000. ## Inputs | Key | Label | Default | Notes | | --- | --- | --- | --- | | `title` | Title on the page | Blocks in a page | Shown above the well. | | `width` | Well width in cells | 10 | From 6 to 12. | | `height` | Well height in cells | 20 | From 12 to 24. | | `next_piece` | Show the next piece | on | A small preview beside the well. | | `ghost` | Show a landing ghost | on | A faint copy where the piece would land. | | `set` | Piece set | seven | seven is the ordinary five-and-two set of shapes. five is a shorter set for a quicker demo. | ## Acceptance at the defaults The numbers, names and fixture paths already in this file are the authority. Where a later table or a shipped fixture file disagrees with prose, the table or the fixture wins. | Fixture | Role | | --- | --- | | `design.md` | A shipped fixture. The build may move it, but then `design.md` must name the new path. | | `fixtures/pdf-after-clear.txt` | A shipped fixture. The build may move it, but then `design.md` must name the new path. | | `fixtures/pdf-clear.json` | A shipped fixture. The build may move it, but then `design.md` must name the new path. | | `fixtures/pieces.json` | A shipped fixture. The build may move it, but then `design.md` must name the new path. | | `spekkr.inputs.json` | A shipped fixture. The build may move it, but then `design.md` must name the new path. | Golden frames are compared at 1400 by 1000 CSS pixels unless a requirement names another size. Tolerance, unless a tighter figure is given above: 8 levels, 98% of pixels, with motion, cursors and clocks frozen as this file says. A build's goldens are of that build; they do not have to match a shipped reference preview pixel-for-pixel if the tool or the type is different, but they do have to match this file's layout, counts and copy. ## Screenshots These pictures are headless-Chrome captures of the working reference in `reference/preview.html`, at the default inputs. They are not drawings of a product that has not been built. The first picture is the one Spekkr shows on the spec's card. A build may ship its own goldens; those goldens are of that build and do not have to match these frames pixel-for-pixel. | File | What it shows | | --- | --- | | `shots/page.png` | A falling-block loop mid-game, drawn inside a document page. | ## How to verify 1. Run the checks at the default inputs, without a network. 2. Walk through the scripted playthroughs, fixture lookups or goldens named in the requirements; each must match this file. 3. Repeat once at the person's inputs when they differ from the defaults. 4. An automated driver (or the embedded script under a test harness) starts a game, places a piece, and clears a line. The first page and three later frames are rendered and checked against goldens. The piece set and art are original. No network and no paid viewer.
-
tasks.mdBuild tasks in order, each with a check.Tasks
Work in order. Finish a task's check before starting the next.
- Set up. Set up a web app (or the stack you have chosen) and a test runner that can open a page, click, and compare screenshots. Read
spekkr.inputs.jsonfirst. Check: a blank or heading page loads, and an empty test run passes. - The page (R1). Build what
R1. The pageasks for, to the numbers indesign.md. In particular: The file is a valid PDF. Opening it shows one page with the well, the title, a score, and the controls. Check: theR1. The pageacceptance checks pass. - Pieces (R2). Build what
R2. Piecesasks for, to the numbers indesign.md. In particular: Thesevenset has the seven shapes indesign.md, each a set of four cells. Thefiveset is the first five of those. Check: theR2. Piecesacceptance checks pass. - A driven game (R3). Build what
R3. A driven gameasks for, to the numbers indesign.md. In particular: The driver can start a game with the seed indesign.md, spawn a documented first piece, slide it, rotate it, and hard-drop it. Check: theR3. A driven gameacceptance checks pass. - Screenshots and files (R4). Build what
R4. Screenshots and filesasks for, to the numbers indesign.md. In particular: Frames are rendered from the PDF or from the same renderer: first-page at spawn, piece-falling mid-drop, line-clear on the flash frame, after-lock after the clear. Check: theR4. Screenshots and filesacceptance checks pass. - Inputs (R5). Build what
R5. Inputsasks for, to the numbers indesign.md. In particular: The build readsspekkr.inputs.json. Settings label the UI, options turn features on or off, and a swap must be one of its choices. Check: theR5. Inputsacceptance checks pass. - Goldens. Capture the frames named in
design.mdat the defaults, with motion frozen where the file says so. Compare them within the stated tolerance. Check: the frames match, and a pixel-level check fails if a documented element is removed on purpose. - Finish. Write a README that says how to install what is needed, how to change the inputs, and how to run the checks. Run the one command from a clean folder. Check: every item under Definition of done in
spec.mdis true.
# Tasks Work in order. Finish a task's check before starting the next. 1. **Set up.** Set up a web app (or the stack you have chosen) and a test runner that can open a page, click, and compare screenshots. Read `spekkr.inputs.json` first. Check: a blank or heading page loads, and an empty test run passes. 2. **The page (R1).** Build what `R1. The page` asks for, to the numbers in `design.md`. In particular: The file is a valid PDF. Opening it shows one page with the well, the title, a score, and the controls. Check: the `R1. The page` acceptance checks pass. 3. **Pieces (R2).** Build what `R2. Pieces` asks for, to the numbers in `design.md`. In particular: The `seven` set has the seven shapes in `design.md`, each a set of four cells. The `five` set is the first five of those. Check: the `R2. Pieces` acceptance checks pass. 4. **A driven game (R3).** Build what `R3. A driven game` asks for, to the numbers in `design.md`. In particular: The driver can start a game with the seed in `design.md`, spawn a documented first piece, slide it, rotate it, and hard-drop it. Check: the `R3. A driven game` acceptance checks pass. 5. **Screenshots and files (R4).** Build what `R4. Screenshots and files` asks for, to the numbers in `design.md`. In particular: Frames are rendered from the PDF or from the same renderer: first-page at spawn, piece-falling mid-drop, line-clear on the flash frame, after-lock after the clear. Check: the `R4. Screenshots and files` acceptance checks pass. 6. **Inputs (R5).** Build what `R5. Inputs` asks for, to the numbers in `design.md`. In particular: The build reads `spekkr.inputs.json`. Settings label the UI, options turn features on or off, and a swap must be one of its choices. Check: the `R5. Inputs` acceptance checks pass. 7. **Goldens.** Capture the frames named in `design.md` at the defaults, with motion frozen where the file says so. Compare them within the stated tolerance. Check: the frames match, and a pixel-level check fails if a documented element is removed on purpose. 8. **Finish.** Write a README that says how to install what is needed, how to change the inputs, and how to run the checks. Run the one command from a clean folder. Check: every item under Definition of done in `spec.md` is true.
- Set up. Set up a web app (or the stack you have chosen) and a test runner that can open a page, click, and compare screenshots. Read
-
reference/preview.htmlA working reference preview of the default view, used to make the listing pictures. A build does not have to start from this file. -
reference/fonts/fonts.cssWebfont faces for the reference preview. -
reference/fonts/Geist.ttfGeist variable typeface for the reference preview. -
reference/fonts/GeistMono.ttfGeist Mono variable typeface for the reference preview. -
reference/fonts/Newsreader.ttfNewsreader variable typeface for the reference preview. -
reference/fonts/Newsreader-Italic.ttfNewsreader italic variable typeface for the reference preview.
Is it for me?
- Kind
- browser game
- Platforms
- web
- Tools
- PDF, JavaScript
What does it need?
- Agent permissions
- shell
- Commands it runs
install a tool that can write and script a PDFinstall a test runner
What changed?
- 0.2.215 Nov 2026Names what it builds.
- 0.2.114 Nov 2026Add animated loop to the listing shots.
- 0.2.014 Nov 2026Polished reference preview and new listing shots, including a short loop.
- 0.1.014 Nov 2026First version.
For agents: start.md says how to build this spec, spec.json holds everything on this page, and bundle.tar.gz holds its files.