One page, no install
The whole game is a set of plain JavaScript files that your browser loads. The 3D graphics use three.js, an open-source library that draws with WebGL, the browser's graphics interface. There is no installer, no plug-in and no separate app. If you can open a web page, you can play. The trade-off is that the game needs a recent browser with WebGL turned on; the troubleshooting table in How to play covers the usual fixes.
The only things that download besides the page are small. The camera controls fetch a tracker model on first use (about 6 MB for Body cam and 10 MB for Hand cam), and your browser keeps it for next time. We keep a size budget for the game's code, and a script checks it, so new features have to earn their weight.
Characters made from numbers
There are no downloaded character models. Each player is built at runtime from a list of numbers: height (the five pros range from 1.83 m to 1.91 m), build, arm and leg length, face shape, hair style and colour, headwear, sleeve length, collar, shorts, socks and the colours of the kit. Change a number and the person changes. That is how five pros, the club player and your own customised player can all exist at almost no download cost.
Movement is built the same way. Players plant their feet, lean into a run and rotate their body on a swing. Each pro also has a style: a serve action, a pre-serve ritual (bouncing the ball, tugging the shirt), a gait and a celebration. The portraits in the menus are real 3D busts of the same characters rendered live, with a flat drawing as the fallback if your graphics cannot do it.
The sounds follow the same idea. Racket hits, bounces on each surface, squeaks, crowd and the menu music are generated by code in the browser, not played from recordings.
The ball is simulated, not scripted
The ball is a 6.7 cm, 57.7 gram sphere that the game steps forward 240 times a second. Each step applies gravity, air drag and a lift force from spin (the Magnus effect), which is why topspin dips and a slice floats. When the ball hits the court, the bounce keeps a share of its downward speed and a friction force grabs the spin. Hard, clay and grass differ in exactly those two numbers (see hard, clay and grass), which is why they play differently. The net has a height that dips in the middle and rises at the posts, and a ball can clip the tape and trickle over.
The court uses the official dimensions. When you hit a shot, the game works out a launch speed and angle that would land the ball where you meant it to go, then adds scatter that depends on timing, pressure, power and how close to the lines you aimed.
Line review
A ball leaves an oval mark when it lands, about 6.5 cm across and 11 cm long. The game uses the real rule: a ball is in if any part of its mark touches the line. Close calls get a line review that draws the mark against the line. If you can see the mark overlapping a line, the ball is never called out.
The opponents
A CPU player has two layers. The first is a set of nine numbers, from 0 to 1, for aggression, topspin, slice, drop shots, net play, serve, consistency, defence and speed. The second is a few readable habits that the numbers cannot say, such as a heavy kick serve and groundstrokes to your backhand, or a lob after its own drop shot. The CPU level (Rookie, Club or Pro) changes how fast it runs, how quickly it reacts, how accurately it hits and how well it chooses shots. We test it by playing many simulated matches in a script, with no graphics, and checking that each pro wins and loses in the ways their style suggests.
How the phone link works
Your phone and the game need to talk fast. They do it with WebRTC, a browser technology for a direct line between two devices. Setting up that line needs an introduction, which is what the QR code does: it carries a code that a small public matchmaking service (PeerJS) uses to introduce your phone and your game to each other. A helper server run by Google helps each device work out its public address. After that the two devices talk directly. If they cannot reach each other directly, the connection can be relayed through a server, which is slower. Everything on the link is encrypted.
What travels over it is small: the speed, direction and timing of each swing, and short status messages. No camera or microphone, and no personal data. The phone itself spots swings from its motion sensors and sends only the result. Online matches against a friend use the same kind of direct line between two browsers.
Privacy by design
- Cameras stay local. Hand cam and Body cam run a model inside the page. Frames are analysed and thrown away; they are never recorded or sent over the network.
- Your save lives in your browser. Settings and progress are stored in your browser's storage on your device.
- The backup is anonymous. The optional online backup uses a random player ID with no name or email. It can be turned off in Settings. An email address is stored only if you choose to create an account.
- Ask for less. Nothing is requested until you press a button for it: the camera asks when you choose a camera control, motion access when you start the racket page.
The full details are in the privacy policy.
Why build it this way?
A browser game can be shared with a link. It runs on a laptop, a school computer, a Chromebook or a handheld. It needs no install and no account. The cost is that we write everything ourselves and watch the size of every feature. We think that is a good trade for a tennis game anyone can try in thirty seconds.
The game relies on open-source work: three.js, Google's MediaPipe trackers and PeerJS. The credits page lists them.