Handmade Web Games
A practical guide to building games for browsers in 2026.
One of the first questions game developers face when starting new project is often: "What engine should I use for this game?" For the web, ever since Flash died, the main options have been Godot, GameMaker, and the behemoth Unity. These engines give you powerful tools, workflows, and entire custom languages designed to provide an end-to-end game-making experience--usually at the expense of fine-grained control and lightweight builds. For many games, they're overkill.
What if you skip the engine?
Another option is to use a library in order to wrap browser APIs and, ideally, provide you with a more ergonomic abstraction to work with. There's anime.js for animation, tone.js for audio, p5.js for canvas drawing and events, and Phaser for all of the above. Having spent time learning these libraries and the underlying APIs that they abstract away, I'm here to tell you that the learning curve is about the same either way. So, why spend time learning an abstraction when you can learn the thing itself?
What if you skip the libraries?
Welcome to this guide. If you want to build web games without heavy engines, learn the fundamental techniques used in game development, and understand and use browser APIs directly, then this guide is for you.
A peek at the upcoming chapters
These 16 chapters introduce the fundamental techniques used in 2D web game development. Many of them are still works in progress! If you'd like to contribute, point out mistakes, or otherwise join the discussion--stay tuned. Community involvement on GitHub and Discord is coming soon.
Tooling for web games in 2026
A minimal and reusable TypeScript + Vite setup for browser games.
Intro to CanvasRenderingContext2D
A tour of the Context2D APIs used to draw shapes, text, and images to a canvas.
Game loops
A game loop that draws at the display's refresh rate while running logic at a reliable fixed timestep.
Animation, pixel art, and sprites
Building on top of the game loop with animation techniques for 2D games, covering: velocity, acceleration, derived movement, easing, springs, grid-based movement, sprite sheets, and pixel art scaling.
Math for games
Movement, randomness, sine waves, aiming, and collision detection in 2D.
Cameras and viewports
How to extend your game world beyond the bounds of the canvas.
Mouse and keyboard input (soon!)
95%Wire keyboard and mouse events into the game loop.
Controllers and haptics
Use the Gamepad API to read buttons, triggers, and analog sticks. Plus, haptic feedback!
Audio
Music, sound effects, and spatial audio with the Web Audio API.
Game feel and juice (soon!)
35%Feedback that makes games feel more responsive and satisfying, with an in-depth look at particles, screen shake, and timing tricks.
Offline mode (soon!)
0%Offline mode and installability with PWAs and cached assets, so repeat visits to your game load much faster.
Devtools (soon!)
1%Profiling techniques and in-browser development tools for games.
WebAssembly (less soon)
1%WASM for high-performance heavy computations, non-garbage-collected memory management, and compilation from low-level languages.
Multithreading (planned)
0%Background work and parallelism with Web Workers.
WebGL and shaders (planned)
0%GPU rendering and shaders with WebGL.
WebGPU (planned)
0%Direct programmatic access to the GPU for graphics and compute.