# Inkline Descent

**Original title:** Inkline Descent
**Inspired by:** the isometric marble maze genre (Marble Madness). The title, courses, art, and code are original.
**Job:** D. Finished and tested 2026-11-14.

## What was built

You tilt a drafting board and roll a marble down four courses ("sheets") against a clock. Time that is left over carries to the next sheet. After sheet 4 the set starts again as "revision B" with less time and double points.

- **Sheet 1, First Line.** Wide paths, two ramps, one kerb, and one safe drop. It teaches momentum.
- **Sheet 2, Section Cut.** A sliding eraser, a bridge of dashed tiles that drop away, a curved bowl with a trench, flow arrows that push sideways, and a second eraser that guards a hall.
- **Sheet 3, Compass Rose.** Two plazas with sweeping compass arms, a half-pipe with bumper pins, and a jump across a gap.
- **Sheet 4, Final Revision.** Ink blots that chase the marble, a bridge one tile wide, a staircase of dashed tiles, a slalom ramp, a sweeper between two kerbs, and a last dashed bridge.

Rules: the marble is lost if it rolls off an edge, drops more than 3.3 height units, or touches a blot. It comes back at the last flag after about one second. The clock is the only life counter. Points come from pickups (50), flags (100), and a bonus for each sheet (400 x sheet number, plus 10 for each second left).

Controls: arrow keys or W A S D tilt the board. Two keys together follow a grid line. Space is the brake. On touch, put a thumb down anywhere below the top bar and drag; a thumb stick appears under the thumb, and the marble rolls in the direction of the drag on the screen. A BRAKE button sits under the right thumb. A mouse drag works in the same way.

## Looks

1. **Blueprint** (main). White ink on blue paper with a faint grid, a sheet border, and a title block that shows the sheet name and the clock. Walls are hatched. Slopes carry contour lines; lines that are close together mean a steep slope. All hazards are drawn in red correction ink, so they stand out from the white drawing. The marble leaves a white ink line behind it.
2. **Toy Blocks.** Painted wooden blocks with wood grain on a quilted play mat. Each height has its own paint colour. The marble is a glass marble, the eraser is pink rubber, and the sweeper is a striped stick.
3. **Card Model.** A layered cardboard contour model on a green cutting mat. Height sets the card tint, and the walls show the stacked card layers. The marble is a steel ball that leaves a red dashed trace.

## Techniques

- Each tile stores four corner heights, so a course can mix flat floors, ramps, and curved surfaces (the bowl and the half-pipe are made from a formula). The ground height under the marble is interpolated between the corners.
- Physics runs at a fixed 120 steps per second: slope force, board tilt, drag, walls (ground much higher than the marble), free fall with gravity, and landing.
- The scene is drawn back to front in tile rows. The marble, flags, pickups, and hazards are sorted into those rows, so walls in front hide things behind them.
- Tile shapes, wall hatching, card layers, and contour lines are built once for each course as stored paths. One frame costs under 1 ms of script time in the test.
- The marble shows real rolling: three marked axes on the ball turn with the motion.
- The paper background is a small tile painted at screen resolution that scrolls with the camera.
- Sound is generated: a rolling rumble that follows the speed, plus short tones for bumps, pickups, flags, falls, and the last ten seconds.
- A self-playing pilot follows a list of points on each course. It runs the start screen, and the test uses it to prove that every sheet can be finished.

## What I am proud of

- Slopes and momentum feel right: a ramp gives speed, the bowl swings the marble, and the jump on sheet 3 works if you trust the slope.
- The blueprint look does real work. The contour lines and red hazard ink make the course easy to read.
- The thumb stick maps the drag direction to the screen direction, so touch play does not need the two-key trick that the keyboard needs.

## Known issues

- I could not play it by hand. The pilot finishes every sheet, and the physics rules are tested, but the difficulty and the time limits (45, 60, 65, 75 seconds) are my estimate. A new player may find sheet 4 hard.
- On a keyboard, a path needs two keys held together because the paths run on the diagonal of the screen. The start card says so.
- Draw order is by tile row. In rare spots the marble can show in front of a wall corner that it is really behind.
- On a 375 px wide phone, the Toy Blocks look uses a wide font, so the top bar takes three rows. Everything still fits on the screen.
- The pilot on the start screen is simple. A sweeper can knock it off sheet 3 once before it gets through.

## Self-test result (2026-11-14, Playwright with Chrome, headless)

- `node .tools/selftest.js 05-inkline-descent`: all checks passed at 375x667, 740x360, and 1440x900. No console errors and no network requests. Start, pause, resume, restart, sound toggle, all three looks, the top bar buttons, the BRAKE button, and the playfield are inside the screen.
- `node .tools/t05.js`: all 45 checks passed. It covers keys, slope force, brake, kerb bounce, safe drop, pickup, flag, edge fall and return, high-drop shatter, sheet clear and carry-over time, the pilot on all four sheets, dashed tiles, flow arrows, blots, look switch, drag control, clock run-out, restart, the tall and wide field, draw cost, and the layout in every look at five phone sizes.
- Issues found and fixed during testing: the dashed tiles never dropped away, because two values shared one name in the code; the first blot on sheet 4 guarded the only way forward, so it was moved; the two blots in the sheet 4 court sat on the exit, so they were moved; the sheet 4 sweeper threw the marble off the pad almost every time, so it now has one arm and two kerbs; the sheet name overlapped the clock in the Toy Blocks title plate.
