A daily course that proves itself, and a replay that fits in a URL
Trickshot is the second game on the daily shell I built for Stormday. The shell was free. The two hard problems were specific to this game: how do you generate a physics puzzle every day and know it can be solved, and how do you let people share a shot when there is no server to store it?
Why a shot game
Stormday is about reflexes. I wanted the second daily to reward the opposite: looking at a still picture, thinking, and committing to one movement. Mini-golf and basketball trick shots both have that shape, and both are satisfying to watch, which matters for a game that spreads by people sending each other results. Putt-style dailies exist; a side-view shot course with portals and wind did not, as far as I could find.
Deterministic physics, again
Everything downstream depends on one property: the same shot on the same course produces the same flight on every device. So the physics is a hand-written 2D ball simulation, stepped at a fixed 240 Hz, with no randomness anywhere. The high rate is not for accuracy so much as for not tunnelling: a full-power ball moves 1,050 px/s, which at 240 Hz is 4.4 pixels a step, comfortably less than the 16-pixel thinnest wall.
Collision is circle-versus-rectangle with the normal snapped to the dominant axis so corners behave like edges. Restitution is 0.58 on everything grey and 1.18 on bounce pads, with a 420 px/s floor on pad exits so a dribbling ball still gets launched. Gravity is 820 pixels per second squared, which with a 360-pixel-wide arena gives a full-power shot roughly a one-second hang time; I picked it once, by judgement, and have not had a reason to change it yet.
The numbers that go into a shot are quantized before simulation, not after. Aim is one of 3,600 angles and one of 1,024 powers. The ball you watch is the quantized ball, so what you saw is exactly what a replay shows.
Generate, then prove
A course is a tee near the floor, a hoop somewhere in the upper two thirds, and two or three gimmicks from a library of eight: blocks, bounce pad, portals, wind band, gravity well, moving hoop, backboard, lid. The seed decides which and where. That part is easy and almost useless on its own, because a random layout is frequently impossible, or trivially a lob.
So every candidate layout is solved before it is accepted. The generator fires 864 shots from the tee, 72 angles around the full circle by 12 power levels, through the real physics, and counts the ones that go in. The rules:
- Fewer than 2 sinks: rejected, too hard or impossible.
- More than 70 sinks: rejected, too easy.
- More than 18 sinks that touched nothing on the way (no bounce, no portal): rejected, because then the gimmicks are decoration and a lob is the whole puzzle.
- Otherwise accepted. Par is 2 if 10 or more samples sink, 3 otherwise.
A second check came from an independent review of the first build: proving the tee is not enough, because a missed shot leaves you somewhere else. So the generator also collects the six most common places a missed tee shot comes to rest and requires, from at least five of them, that a coarser search (24 angles by 6 powers) still finds a sink. Each rejected layout costs one more roll of the seed, up to forty. With both checks the first thirty days needed a median of two attempts (the worst day, ten), and generation takes about 0.3 seconds in the browser, up to 0.9 on a bad day. The pay-off is a guarantee I can print on the page: every course can be made in one stroke. Sample counts for accepted days so far range from 2 to 12 of 864, which is the right kind of hard: an ace is real but rare, and the solver's solutions are the sort of thing a person finds on a third round, not a first.
Two safety rails exist specifically because the solver runs every shot to completion: a 0.25-second cooldown after each teleport, so a ball cannot ping-pong between two portal rings forever, and a nine-second cap per stroke, so a ball wedged somewhere without a floor under it (rest detection needs contact) still ends the stroke. Without those the generator could hang on a single pathological layout.
The replay is the URL
Because physics is deterministic, a replay needs nothing but the inputs. A stroke is 12 bits of angle and 10 bits of power: 22 bits. Base-64 that, prefix a version character, and a hole-in-one is five characters: ?r=1ku9Q. A ten-stroke DNF is 38. The link includes the date, so it rebuilds the right course, runs the strokes through the same simulation, and then offers the course to play.
This matters more than it sounds. Most daily games share a result; Trickshot shares the solution, and the receiver gets to watch it before they try. That is a different kind of message to send a friend. It also costs me nothing: no database, no uploads, no moderation.
Writing a GIF encoder in 2026
I also wanted a shareable image, because chat apps show those inline and links get ignored. The browser has no built-in animated-image encoder, and I did not want a dependency for one feature, so I wrote a minimal GIF89a encoder: a fixed 256-colour palette (a 6×6×6 cube plus 40 greys, which is plenty for a game with six colours), LZW compression, Netscape loop extension. It is about 120 lines. The result card renders the replay to an offscreen 240×360 canvas at 12 frames per second and encodes it in a few hundred milliseconds; a one-stroke replay is around 145 KB. On phones that support sharing files, it goes straight to the share sheet; elsewhere it downloads.
Things I cut
- A trajectory preview that accounts for the course. putt-style games often show the full path. Here it would have solved the puzzle for you; the preview is a short, plain parabola and the gimmicks are deliberately not simulated in it.
- Strokes from where the ball lands only if it lands "in bounds". There are no bounds. The box is closed, and laying up onto a ledge is a legitimate strategy, so wherever the ball rests is a legal tee.
- A separate "ace" leaderboard. No leaderboards at all until the anonymous backend exists, same rule as Stormday. The share card and the replay link are the social layer for now.
- Random variation between rounds. All three rounds are the identical course. Round two is where you use what round one taught you; that is the point.
What's next
The first week of real courses will tell me whether par is honest. The generator's thresholds (2, 70, 18) came from watching thirty generated days and a lot of my own missed shots, and real people will certainly find courses I think are par 3 that are par 1 for them. Changes to the generator only ever apply to future dates, so replay links never break.
Found a course that felt broken? contact@arcadesnap.com, with the day number and ideally the replay link.