Add a pong animation

The video frame plays the paddle: it slides along the bottom of the
screen and nowhere else, a square ball runs the diagonals off the walls,
and every ball that gets past the frame puts one on a seven-segment
counter in the top right.

The frame is solid on all four sides, not just its face, so a ball that
comes at its flank or up under it is turned away too. Which side a hit
came in on is read from where the ball was before the step, with a
shallowest-penetration fallback for the frame sliding into the ball
rather than the other way round — without that the ball tunnels in and
rattles inside the frame. The face keeps the original's angle rule, where
the hit position sets the departure angle, so rallies develop instead of
the ball retracing one line; the other three sides are plain reflections.

The paddle steers by predictLanding, which unfolds the wall reflections
analytically instead of simulating them. A paddle that outruns the ball
never loses, so PONG_MISS_CHANCE of the time it aims a width wide and
lets one through — otherwise the counter would sit on 00 all night.

The digits are SVG polygons built from a segment map, so the era-correct
display costs no font file.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H9v2Xoa6eoeGYpK6gp95k9
This commit is contained in:
simon
2026-08-10 20:29:01 +02:00
co-authored by Claude Opus 5
parent ade77b4c38
commit bb5f87ff05
4 changed files with 523 additions and 1 deletions
+9 -1
View File
@@ -39,7 +39,7 @@ autoplay, so the first click is what unlocks audio. One click per session.
## Animations
The video frame's movement changes with every track. Five animations ship
The video frame's movement changes with every track. Six animations ship
today:
- **bounce** — diagonal drift, reflecting off the screen edges.
@@ -51,6 +51,14 @@ today:
one corner and pulls the frame to a new size. The aspect ratio stays locked
and the frame stays on screen, so the resize reads as a window resize rather
than a stretch.
- **pong** — the 1972 game with the frame cast as the paddle: it slides along
the bottom of the screen and nowhere else, a square ball runs the diagonals
off the walls, and where the ball lands on the frame's face sets the angle it
leaves at. The frame is solid on all four sides, so a ball that comes at its
flank or up under it is turned away too. It plays the ball's predicted
landing spot, but aims a width wide
once in a while, and every ball that gets past it puts one on the
seven-segment counter in the top right.
- **trail** — the frame glides along a curving path, steering from waypoint to
waypoint, and drops a screenshot of itself every frame-width or so. The stills
stay where they were taken and fade over a few seconds, leaving a comet tail of