Hot Walk build log - WordPad
✕
C:\ar9av\builds\HOTWALK.TXT
  1. Desktop
  2. Build Log
  3. Games

Build log · Games

How I built Hot Walk

Dash out of a spinning horse hot walker between its eight steel arms

Screenshot of Hot Walk running in the portfolio
Hot Walk, running on the desktop. Open it yourself →

1.Why I built it

Hot Walk recreates a reel about the games you play on a ranch. A hot walker is a post with steel arms that walks horses in a circle, and the game is to stand by the post and run out between the arms without getting hit.

It is a single input with a clear rule, which made it a good fit for a short browser game. The difficulty comes from changing the rhythm rather than adding controls: every escape speeds the walker up, later rounds can reverse, and three bonks end the run.

2.How it works

Keeping the rules in a pure module

All the geometry and rules live in sim.ts, kept free of rendering so they can be tested headlessly. It defines the pen (inner rail RI = 86 px, outer rail RO = 188 px), eight arms that only sweep the alley between the rails, a dash speed of 470 px/s, and the gate half-angles at the bottom of the pen.

Difficulty is two small functions. speedMul(score) returns 1 + 0.1 per escape, capped at 1.8. omega(score, t, dir) turns that into angular velocity and, from score 8 on, multiplies it by 1 + 0.2 * sin(1.7t) so the speed wobbles and you can't just count beats. After 5 escapes, each success has a 30% chance of flipping the direction.

Collision as clearance, not a hit test

Because the player only ever moves straight down the dash line, collision reduces to one question: how far is the player from the nearest arm at radius r? clearance(rot, r) rotates each arm into its own frame, clamps the player's projection onto the arm segment, and returns the distance minus the player radius and arm half-thickness. Negative means smacked.

Returning a distance instead of a boolean pays off twice. The game tracks the minimum clearance during each dash, and if it dipped under 5 px the escape is called out as CLOSE CALL instead of ESCAPED.

A fixed 60 Hz step

The loop accumulates real elapsed time and runs step() in fixed 1/60 s increments, capping the backlog at 250 ms, then draws once per animation frame. Without this, a 120 Hz display would spin the walker twice as fast. A clank sound fires whenever the arm index crossing the gate changes between steps, which doubles as an audio timing cue.

Sketchbook ink drawn in code

The pen, rails, arms and post are all drawn with Canvas 2D in ink on cream paper. Each line is stroked twice with small offsets from a deterministic hash, and the hash seed changes five times a second (boil()), so the lines shimmer like hand-drawn animation without random flicker. Arcs are built from short segments with a radius jitter, and straight lines use a jittered quadratic curve.

Only the characters are images. scripts/generate-hotwalk-sprites.mjs asks the OpenAI Images API for a top-down rancher sheet (stand, two run frames, dizzy) and a waist-up smacked rancher for the BONK! and GAME OVER cards, on a flat magenta background. The script flood-fills the key colour from the border, paints over grid lines the model draws between cells, and despills pink fringes before slicing frames.

Synth sounds and a deduplicated leaderboard

Sounds come from a tiny Web Audio class: pitched oscillators with exponential frequency and gain ramps for the clank, escape and game-over notes, plus bandpass-filtered noise buffers for the dash and the bonk. Scores go to a Convex table, hotwalk_scores, and the leaderboard query walks the score index and keeps only each name's best row so one player can't fill the board.

3.Try it

Tap, click, or press Space, Enter or Down to sprint out through the gates; P or Esc pauses, M mutes.

More from the build log

Hot Walk · 3 min readAll 29 builds