?What is a “web game”?
A web game is a game that runs in a browser (Chrome, Firefox, Safari…) without installing anything. You click a link, and it plays!
For that to work, we put together three ingredients you may already know:
- 🧱 HTML — the structure of the page (the “bricks”).
- 🎨 CSS — the styling: colours, sizes, layout.
- ⚙️ JavaScript — the brain: it's what makes things move.
Our game draws everything inside a special area called a canvas (a digital painter's “canvas”). We use a toolbox, Phaser, which handles the tricky parts (displaying, animating, listening to the keyboard) so we can focus on the game.
★The game we're building
Two towers, one on each side of a landscape. Each player sets the angle and the power of their cannon, taking the wind into account. The twist: both players aim at the same time, then both shots fire together. The first to hit the opposite tower wins the round!
We built the game in 5 steps (we call them “batches”). Each chapter tells one step, with its own biome mood:
Make a cannon move
The game loop, the path of a cannonball, and how we “wrap up” the game with Docker.
Make it look good
Scenery (biomes), particles, depth (parallax) and sound effects made by code.
Play across several screens
The TV displays, the phones control. A server referees the match in real time.
Destroy the landscape
Like in Worms: every shot digs a crater. We'll see the magic trick to “punch a hole” in an image.
The sound of wind
Sound 100% synthesized in Web Audio: four wind characters, adapting to strength, and a stereo cue for direction — with a simulator.
↑Choose your level
Every chapter comes in three depths. Read the one that fits — or climb from one to the next as your curiosity grows. (The level switcher sits at the top of each chapter, so you can jump anytime.)
Start here
The friendly tour, with diagrams and little games to play with. No code background needed.
The architecture
How the project is actually structured: the game loop, scenes, the simulation/rendering split, the protocol.
In depth
The engine internals: numerical integration, determinism, netcode, procedural synthesis and fast maths.
iHow to read this notebook
You'll come across little coloured boxes. Here's what they mean:
And blocks of real game code, like this one:
// once both players have confirmed, we fire! if (tower1.ready && tower2.ready) { fire(); }
📎Annexes
Extras to go further: deploy the game yourself, a detour through the maths, and the behind-the-scenes of the starting brief.
- 🎮 Match life cycle — Lobby, Architect/Rival personas, state machine and reconnection — with 4 interactive simulators.
- 🧮 Quick maths — The square root, the legend of Quake III's
0x5f3759df, and how Pythagoras avoids the calculation. - 🧭 Pathfinding — How soldiers find their way across destructible terrain riddled with structures — a graph of surfaces, an A*, and the third player's oscilloscope that already visualises it.
- ⚙️ Deployment — Build the Docker image and host the game online (alwaysdata, VPS, container platform, static).
- 📝 The starting brief — The spec that started it all — presented, annotated and critiqued: how to describe a project well.