explaingit

jgbrwn/cannonsmash-web

Analysis updated 2026-05-18

2TypeScriptAudience · generalComplexity · 2/5LicenseSetup · easy

TLDR

A touch-friendly browser remake of the classic 3D table tennis game Cannon Smash, playable instantly at a live link.

Mindmap

mindmap
  root((repo))
    What it does
      Touch remake of Cannon Smash
      3D table tennis physics
      Assisted positioning
    Tech stack
      TypeScript
      three.js
      Vite
      nginx
    Use cases
      Play on mobile
      Study touch controls
      Self-host static build
    Audience
      Casual players
      Retro game fans

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Play a full 3D table tennis match on a phone or tablet using touch gestures.

USE CASE 2

Study the project as an example of adapting an old open source game's physics to touch controls.

USE CASE 3

Deploy the static build behind nginx to self-host the game.

What is it built with?

TypeScriptthree.jsVitenginx

How does it compare?

jgbrwn/cannonsmash-web4ssh1/mine-sweeperachawla19/intuitcode-extension
Stars222
LanguageTypeScriptTypeScriptTypeScript
Last pushed2026-01-31
MaintenanceMaintained
Setup difficultyeasymoderatemoderate
Complexity2/52/54/5
Audiencegeneralvibe coderdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Playable instantly online, local development just needs npm install.

You can use and modify this freely, but any modified version you distribute must also be open source under the same license.

In plain English

CannonSmash Web is a browser based remake of Cannon Smash, an older open source 3D table tennis game, rebuilt for touch screens and mobile phones. The goal is to keep the original's physics and its assisted control feel while making it playable with a finger instead of a keyboard and mouse. You can try it directly at the project's live link without installing anything. The controls are all gesture based. Dragging left or right moves your paddle sideways. A flick upward swings and hits the ball, where the angle of the flick aims the shot, the speed and length of the flick set the power, and an upward flick adds topspin. A flick downward gives a backspin push. On your own serve, a flick tosses the ball and serves it. There is an X button at the top to quit a match and a simple tap to return to the menu afterward. The game is faithful to the original in one important way: the ball must actually be within reach of your paddle when it arrives, so being out of position means you will whiff the shot. When you are not actively dragging, the game gently nudges your position toward where the ball is predicted to land, similar to how the original game auto positioned players during the backswing. This assist becomes weaker at higher difficulty settings, so manual positioning matters more as you improve. Matches follow standard table tennis style rules: games to eleven points, win by two, serve rotating every two points except at deuce, and a match is best of three games. The project is written in TypeScript and uses Vite for development and building, with a simple typecheck command and two headless simulation scripts for automated testing. In production it is served as a static build through nginx with caching rules for fast repeat loads. It is licensed under the GNU General Public License version 2, with credit given to the original Cannon Smash game and to the three.js library it depends on for its 3D rendering.

Copy-paste prompts

Prompt 1
Help me run CannonSmash Web locally with npm install and npm run dev.
Prompt 2
Explain how the flick gesture controls in CannonSmash Web map to swing angle, power, and spin.
Prompt 3
Show me how to build and deploy CannonSmash Web as a static site behind nginx.
Prompt 4
Walk me through the headless match simulation scripts in CannonSmash Web's test folder.

Frequently asked questions

What is cannonsmash-web?

A touch-friendly browser remake of the classic 3D table tennis game Cannon Smash, playable instantly at a live link.

What language is cannonsmash-web written in?

Mainly TypeScript. The stack also includes TypeScript, three.js, Vite.

What license does cannonsmash-web use?

You can use and modify this freely, but any modified version you distribute must also be open source under the same license.

How hard is cannonsmash-web to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is cannonsmash-web for?

Mainly general.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.