A samurai sled run with upgrades, painted like sumi-e ink on rice paper. A samurai rides a battering-ram sled from a mountain shrine down 3,000 m to a castle in the valley: the Shrine Slope through bamboo, the Frozen Lake, a Mountain Village ridden over its rooftops, a Gorge of rope bridges and ravines, and the Castle Gate. Each run ends when the sled comes to rest, breaks apart or falls; the zeni it earned buys upgrades in the dojo, and the next run goes further. The gate falls only to the dragon ram. After the castle, Blizzard mode runs the pass at night, harder, for ×1.5 zeni.
How it's built
- Rules apart from drawing.
core/ is plain TypeScript with no Phaser import: every balance number in config.ts, a seeded terrain generator (terrain.ts), the run simulation stepped at a fixed 120 Hz (run.ts), the profile with upgrades, styles, missions and save validation (profile.ts), and a bot rider (pilot.ts). The same seed and the same inputs always play the same run, which the tests rely on. - The mountain. A height field sampled every 0.5 m is stitched together from hand-made chunk templates per zone: rolling slopes, dips with a counter-slope that a slow sled cannot climb, kickers with a lip, terraces with stone walls, ice holes and pressure ridges on the lake, rows of houses whose roofs are the track (upturned eaves kick the sled across the alleys), ravines, sagging rope bridges with archer towers, ramparts and a moat. Every zone ends with a fixed set piece (the great torii jump, the crack chase, the rooftop run, the long bridge, the moat), and a plain landing slope always follows anything that throws the sled into the air.
- Physics without an engine. On the ground the sled moves along the slope under gravity, runner friction (lower on ice, higher on wood and stone) and drag; when the ground falls away faster than a ballistic arc it takes off. In the air the lean keys spin it, holding jump opens the banner as a sail that cancels part of gravity, and the landing compares the sled's angle with the slope: clean, rough (speed and hull lost) or a crash. Each drum beat spends ki for a burst of speed. Flips, long glides and clean landings after real air time pay trick zeni.
- Foes and walls. Spearmen brace as the sled nears, archers aim for half a second while a dotted red arc shows where the arrow will fly (cut it to deflect it; with the last blade it flies back at the archer), shield bearers only stagger under a weak blade, ninjas leap from the ridges at where the sled will be, and elite samurai parry the first cut and strike back after a red warning. Fences, palisades, rolling logs and ice boulders need a ram of the right tier; hitting anything without one costs hull and speed but never ends the run on the spot. Soldiers further down the mountain hit harder.
- Economy and balance. One currency, zeni: distance (more per metre in deeper zones), soldiers, breaks, tricks, coins and lacquer chests, a bonus beyond the best distance, three scroll missions at a time and a first-arrival bonus per zone. Six upgrade tracks with five levels each (the ram has four) cost
base × 3^level (the ram 4). core/balance.test.ts plays three whole careers with the bot, which re-plans every few steps, buys the cheapest upgrade (the ram first once it has reached the gate) and switches to Blizzard mode after the castle. It checks that the first run goes about 300 m and pays about 130 zeni, that a purchase never takes more than four runs, and that the castle falls around run 20: the bot takes it on runs 19 to 24 (median 22) and maxes the sled around runs 31 to 35. - Art painted in code. Every sprite is drawn on 2D canvases in metre units at twice the display resolution: the samurai in five armours and five masks, the sled whose runners, ram (wooden wedge, iron wedge, bronze guardian lion, dragon head), drum, hull plates and blade visibly change with each level, the foot soldiers, torii, shrine, bamboo, pines, stone lanterns, jizo statues, village houses, carts, wells, watchtowers, rock spires, the gatehouse and the castle keep. Light falls from the sun on the upper right, so shade sits on the left and shadows fall lower left. The snow, the ink edge of the slope, the ice, the ravines, the water and the rope bridges are drawn with Phaser graphics each frame; three parallax ink-wash backdrops per zone are painted once per zone.
- The banner is a small Verlet strip that streams back in the wind and spreads wide while gliding; each style carries an original geometric crest built from circles and strokes.
- Sound and music are synthesised with Web Audio: snow hiss and ice scrape that follow the speed, wood knocks on bridges, wind that rises in the air, Karplus–Strong koto plucks, a breathy shakuhachi-like voice, taiko and an inharmonic gong through a generated reverb, all behind a compressor. The music is generative in the in scale on D and adds layers with speed and depth; the dojo plays a calm koto.
- Phones and desktops. Keyboard (Space, J, A and D, Shift), mouse (right half or right button jumps, left half cuts) and touch (tap or hold the right half to jump and glide, swipe or the blade button to cut, lean and drum buttons at the bottom left, all at least 56 px and clear of the safe area). In portrait the camera narrows its view and moves the rider left so the slope ahead stays in sight.
- Interface in the game's own style: the HUD is a brush mountain line from shrine to castle with the best-distance flag, a mon coin counter, lamellar hull plates, taiko beats for ki and a red sail gauge; the tally is a scroll that unrolls row by row with a hanko stamp for a new best; the dojo is an ink-painted room with six ema plaques and a sled preview that ghosts the next part on hover; the pause screen is a folded paper card. All arrows are drawn brush strokes.
- Reduced motion: no screen shake, flashes, hit-stop or slow motion, fewer particles, slower snow and banners that fade instead of unfurling; the game plays the same. The game sleeps when the tab is hidden, the page scrolls it away or the dojo covers it, and pauses itself on blur.
- Styles and themes. Seven style slots (armour, mask, helmet crest, banner with an original geometric crest, sled finish, snow trail, cut ink) with 45 items painted by the same code as the game and previewed in the dojo; four world themes change sky, sun or moon, backdrop tints, snow colour, what falls (snow, plum petals, maple leaves) and whether lanterns glow, with no effect on the ride. Blizzard mode (after the castle) is the hard mode with its own night look.
- Economy extras: combo chains (+10 % per link, up to ×1.5), near-miss bonuses, one-time 500 m milestones, a first-run-of-the-day bonus with no penalty for missed days, and New Pass+ after the castle, which resets the sled for a permanent zeni bonus. Older saves are upgraded in place.
- Debug parameters:
?autopilot lets the bot ride, ?showcase is the rooftop run used for the card and poster, ?zone=n starts runs at a zone, ?rich gives every upgrade and ?nohud hides the interface ?theme=plum (or maple, mist) previews a theme, and ?end=n ends each run after n seconds (for tally screenshots).
Feel pass (2026-11-15)
- Momentum: over a crest the ground bends away under a fast sled; when speed² × bend beats
PHYS.crestG × gravity the sled leaves the snow instead of tracing the line (never within 75 m of a gap, so the designed jumps stay fair). A press just after a ground jump no longer double-jumps. - Overturning ends the run: landing more than 70° off the slope (on the back or the head) is
EndReason "flipped". A tap hops, a hold just after take-off rises higher, and with no lean held the sled eases toward the slope below it. - A clean landing flat to the slope (under 11°) after real air is "Perfect!" and adds
PHYS.perfectBoost speed. - The drawn sled rides a slightly underdamped pitch spring and the samurai sits on his own spring (
bob), so jumps and landings have weight. Hills and drifts are drawn as convex columns (a single long polygon folded over itself at steep drops and left black wedges). - Scenery you cannot touch (trees, houses, wells, lanterns, rocks) is veiled and turns see-through when the sled passes in front; foes and obstacles carry a pale silhouette halo. Upgrades cost 1.35× the base table so the castle still falls around run 20.
- Simple to read (2026-11-15): every ice hole and ravine has red pennants on both lips and a red jump sign with a bobbing double chevron 11 m before it; walls and boulders the sled cannot smash yet carry a bobbing red chevron; holes are drawn as banded ice walls over open water (they used to read as black blocks). The samurai cuts a soldier in reach by himself (
autoCut run option, on in the game, off for the bot), the blade key still strikes on demand. - Clarity and blur (2026-11-15): the faint grey foreground silhouettes were removed (they read as motion blur at speed), the zoom-out at speed is smaller (33 + 5 m instead of 32 + 10 m), the snow spray is capped, parallax offsets snap to whole screen pixels, the three nearer backdrop layers are drawn lighter (alpha 1, 0.95, 0.7, 0.6) and every foe and obstacle sits in a soft light glow plus its pale silhouette. A BETA stamp is on the title screen and the dojo, and the example is ordered last (
order: 200) in the Lab lists.