A browser-based, mobile-first remake of Cannon Smash (the classic open-source 3D table tennis game), true to the original's physics and assisted-control feel, rebuilt around touch.
archive.org original website link: https://web.archive.org/web/20220130185354/http://cannonsmash.sourceforge.net/
Play: https://cannonsmash.exe.xyz/
| Gesture | Action |
|---|---|
| Drag left/right | Move your player/paddle laterally (finger = paddle) |
| Flick up | Swing. Flick angle aims left/right, flick speed & length = power, upward flick = topspin drive |
| Flick down | Backspin push |
| Flick (on your serve) | Toss + serve |
| ✕ (top center) | Quit match, back to menu |
| Tap (after match) | Return to menu |
The ball must actually be within paddle reach when it arrives — if you're out of position, you whiff. When you're not dragging, a positioning assist drifts you toward the predicted contact point (the original game also auto-positioned during the backswing); the assist gets slower on higher difficulties, so manual positioning matters more.
11-point games, deuce (win by 2), serve rotation every 2 points (every point at deuce), best of 3 games.
npm install
npm run dev # vite dev server on :8000
npm run build # production build to dist/
npm run typecheck
npx tsx test/sim.ts # headless full-match simulation
npx tsx test/human.ts # sloppy-human sim across all difficulties
Deployed as a static build served by nginx with gzip compression and aggressive caching (immutable cache headers for content-hashed assets, short-lived cache for HTML). After building:
npm run build
sudo systemctl restart cannonsmash # syncs build to nginx serve dir (rsync)
See cannonsmash.service for the deployment process and the nginx config at
/etc/nginx/sites-available/cannonsmash for server tuning.
See docs/DESIGN.md for architecture, physics notes, tuning rationale, and the project plan/history.
This project is licensed under the GNU General Public License v2. See LICENSE for full terms.
See NOTICE for attribution of the original Cannon Smash game, three.js, and other third-party dependencies.

