peer2peergames

Air Hockey

Two mallets, one puck and a table two metres long, played live with both of you on it at once. The puck slides on a cushion of air, a goal is the puck through the slot at the far end, and the first to seven wins. Your mallet is the finger on your half of the table; it never crosses the centre line.

Play Air Hockey Leaderboard

The table

  1. The playfield is two metres by one, and the site draws it the way up that suits your screen: portrait on a phone with your goal at the bottom, landscape on a desk with it on the left.
  2. A goal is the slot in the rail at each end, the mouth. It is three pucks wide, which is wider than a tournament table's: a table played with a thumb needs a mouth a thumb can find.
  3. The centre line splits the table into your half and theirs. The centre of your mallet never crosses it: drag past the line and the mallet stops on it.
  4. The puck is a disc a little smaller than the mallet, and it keeps going: a hard shot rebounds off two or three cushions before it slows.

Playing

  1. Nothing is served until both players have pressed Ready, so nobody arrives at a rally the bot has been playing for them.
  2. A serve puts the puck at rest in the receiver's half, held for a second, then live. Only the receiver's mallet can reach it, and the player scored on serves the next point.
  3. Move your mallet with a finger or a pointer anywhere on your half; on a laptop the arrow keys and W, A, S and D do the same. The mallet follows the finger at a capped speed, so a flick is a flick and not a teleport.
  4. Strike through the puck toward the far mouth, or off a side cushion when the mallet in front of it is in the way: a bank.
  5. A puck touching the centre line can be struck by either player.

How a rally ends

  1. A goal: the centre of the puck crosses the line of the mouth, and the point goes to the player at the other end.
  2. A stall: if the puck sits in one half for seven seconds without crossing the centre line, the rally ends with no point and the puck goes to the other player for a serve. A countdown appears by the score for the last few seconds.
  3. A rally still going after a minute ends the same way, as a stall against whoever has the puck. A rally between two people never gets near it.
  4. A rally is stored as both players' mallet positions on the ticks they changed, so a finished match can be replayed and checked from its log.

The match

  1. First to seven points wins. There is no margin: seven beats six.
  2. Both players are on the table at once, so the site's move deadline of five minutes is only a dead man's switch: if nothing at all happens for that long the match is abandoned and nobody is rated.
  3. A player who resigns loses the match. At a table with the bot in it the match is not rated.
  4. A player who drops out is covered by the bot within half a second and gets the mallet back the moment they return. Somebody who loses two rallies in a row while away forfeits the match; somebody whose phone dropped for a moment keeps playing.

Worth knowing before you start

  1. Air Hockey needs a live connection. If your browser or network cannot open one the page says so rather than offering a table that cannot move.
  2. The puck is simulated on the server fifty times a second, and your page draws it from the server's word. Your own mallet answers your finger at once, because the rule that caps its speed is applied on your page exactly as on the server.
  3. If your connection hiccups the server is right and your page catches the puck up to where the server has it.
  4. The bot plays at one of three strengths, drawn per match from the seed. The weakest stands in front of its mouth and reacts late; the strongest reads where the puck will cross its line, strikes at the side of the mouth you are not covering, and banks when you are.
  5. Air Hockey is the name of the sport, and this table is the site's own: no maker's table, colours or furniture are copied.

The puck is one shared object that both mallets touch, so a rally cannot be re-run from one player's inputs the way a race lane can: every frame is honoured on the tick it arrives, the latest one winning, and a frame that arrives late is simply late. That is why your own mallet is drawn from your finger at once and the puck from the server, and why the round trip is felt only on the puck. The server runs the same physics fifty times a second and is the clock, so a fast connection cannot buy a faster mallet and a slow one cannot lose you a shot you made.

Air Hockey terms

The puck
The disc. It slides on a cushion of air and is the only thing on the table the server moves on its own.
A mallet
The disc you hold, the striker. It is twenty times the puck's weight, so a hit is the mallet's, and it never crosses the centre line.
The mouth
The goal slot cut through the rail at each end. Three pucks wide here.
A rally
From a serve to a goal or a stall. A match is a run of them; a stall is a rally with no point.
The serve
The puck placed at rest in the receiver's half, held for a second, then live. The player scored on serves.
A stall
Seven seconds with the puck in one half and no shot across the centre line. No point; the puck goes to the other player.
A bank
A shot off a side cushion, for when the straight line to the mouth is covered.
The centre line
The line across the middle of the table. Your mallet stays on your side of it; the puck does not care.

Playing it here

  • Against a person or the bot. The bot needs no account and starts at once. To play a person, be rated and keep your games, you need an account: an email address and a password.
  • At your own pace. Every move has a deadline you both see, from one minute to a week. A game can take an evening or it can take a fortnight.
  • Nothing to buy and nothing to win. No stakes, no prizes, no boosts, no undo. The only thing on offer is a place on a leaderboard, and only if you want one.
  • Every game can be checked. Anything decided by chance comes from the game's seed, and the seed is published the moment the game ends, so any finished game can be replayed and verified by anyone. See fair play.