# Air Hockey — air-hockey.skillsafe.ai Tournament air hockey in the browser, in true 3D, refereed by the USAA rulebook. Free, no sign-in, no network calls, nothing to install. WebGL2 required. ## What it is A from-scratch reimplementation: its own physics engine, its own hand-written WebGL2 renderer, no libraries. You move your mouse or drag a finger and your hand IS the mallet — there is no aiming and no power meter, because a real air hockey player has neither. Four difficulty levels, stated as what they actually are: reaction times of 340, 235, 150 and 90 milliseconds. ## What is faithful The rules are complete and cited by rule number to the USAA "Air Hockey Rules of Play" (rev. 03/03/2020) and "Challenge Match Rules" (rev. 03/23/2019): - seven points wins a game (I.1); a set is four games of seven (Challenge 3.1); ends change after each game (I.3); there is no win-by-two anywhere - the face-off, with the referee's one-to-four-second pause and one free false start each (III.2) - the seven-second rule, whose first violation in a match is a warning and not a foul (I.10) - ten seconds to restart after being scored upon (I.17); one ten-second time-out per GAME, not per match (I.14) — and a second one draws a conduct warning rather than being refused (IV.4) - palming (I.13), and goal-tending, which is a TECHNICAL foul and awards a free shot at the guilty player's unprotected goal (VI.6, VI.2) - topping, with its quantitative definition: tilting the mallet past forty degrees (I.8, IX.14) — while merely lifting the mallet and striking is explicitly legal (IX.11) - the centreline reach limit, which turns out to be a number: the mallet's centre may be at most one radius past the line, because VI.13's two clauses say the same thing about a disc - the four different outcomes of a puck leaving the table (VI.8, VI.15's two halves, VI.16) - the conduct ladder: second warning a foul, third a technical, fourth forfeits the game, fifth the match (VII.1); and the advantage rule that declines to stop play at all (IX.15) ## Three things worth knowing about the rulebook 1. **It fixes almost no dimension.** Tables and pucks are approved BY MODEL NAME (II.A.1.a, II.C.1). The only measurements in the whole document are the mallet's: 6 oz or less, diameter under 4-1/16 in (II.B.1). The geometry in this app therefore comes from the maker of the approved table and from the original 1971 Brunswick patents. 2. **It says nothing quantitative about the air system.** The words blower, hole and pressure do not appear. The 0.032 in hole on a one inch grid comes from patent US 3,773,325. 3. **There is no crease in air hockey.** The word appears zero times. It is an ice-hockey concept. ## The air cushion The puck is not given a friction constant. The playfield is a plate perforated by about 4,600 holes of 0.032 in on a one inch grid, fed from a plenum, and the app solves Reynolds' thin-film equation for the gap at which the lift balances the puck's weight — 183 micrometres at the default blower setting. Halve the gap and the lift goes up eightfold; that h-cubed stiffness is why a puck settles at a definite height. Turn the blower below the puck's areal weight and the cushion cannot lift it at all: it slides on the laminate and stops in under a metre instead of running three table lengths. The app has a slider for it, and prints the gap, the film pressure and the flow. The total linear drag rate is measured, not invented: 0.2344 per second, the mean of two rates identified from tracked real puck trajectories in a published robot-air-hockey benchmark. Of that, the viscous shear the cushion model derives accounts for about 5%. The app says so on screen. ## Why the build was unusual It is a real-time game, so "correct" includes frame-rate independence: the same input must give the same game at any refresh rate. The engine uses a fixed 1/480 s timestep with an accumulator, timestamps every pointer sample and samples it at the substep's own time, and drives the opponent from inside the substep rather than from the frame loop. All three are necessary, and the test suite proves the result is BITWISE IDENTICAL across nine frame rates from 30 to 240 fps and through a jittery loop with dropped and doubled frames — with must-fail controls showing that a velocity-scaled integrator, a per-frame-polled opponent and per-frame input sampling all diverge. ## Credits Air hockey was invented at Brunswick Billiards, 1969–1972, by Phil Crossman, Bob Lemieux and Brad Baldwin, and patented by Brunswick Corporation (US 3,773,325 and US 3,927,885, priority 1971). This app is an independent reimplementation and is not affiliated with Brunswick, Gold Standard Games, Valley-Dynamo, Shelti or the United States Air Hockey Association. Every source and every reconstruction is listed in /CREDITS.txt.