Skip to content
Ian Knight
Making Browser Games

Making Browser Games

projects misc

I’ve ended up making a bunch of small browser games over the past while. They all follow pretty much the same rule: one HTML file, no dependencies, no build step, and no framework. Canvas 2D handles the graphics, the Web Audio API handles sound, and vanilla JavaScript handles everything else. Open the file and it runs.

Part of the reason I started doing this was nostalgia. A lot of these are based on games I grew up playing. I wanted to see if I could rebuild some of the ideas from scratch and actually understand how they worked. Each one ended up teaching me something different.

ABYSS is the biggest one. It’s a Doom-style raycasting FPS. The hardest part was getting the raycasting engine working: it casts a ray for each vertical strip of the screen, figures out where it hits a wall, and then uses the distance to work out how tall that wall should look. The math itself isn’t that bad; getting all of it to actually look right was the fun part. It has a full weapon set, several enemy types, and a save system.

Cave Crusher is a Dig Dug-style game. You dig through dirt while enemies chase you through the tunnels you’ve made. The interesting part was the tunnel system. The game tracks which grid cells have been dug out and makes sure the enemies actually follow the tunnels instead of just walking through solid dirt.

Star Squadron is a Galaga-style vertical shooter. Enemy formations, wave patterns, and the usual dodge-and-shoot gameplay are the main parts of it.

Balloon Siege is a tower defense game. The goal is pretty simple: pop the balloons before they make it to the end of the path. Most of the work here was getting the wave spawning and basic pathfinding working.

Ricochet is a paddle-and-ball game somewhere between Breakout and Pong. It looks like it should be easy. Getting the physics to feel right took more work than I expected.

Midnight Blackjack and Maison Roulette were a little different. Midnight Blackjack is mostly card shuffling and dealing logic. Maison Roulette is a spinning wheel and betting system. Neither one needed the same kind of game loop as the others, which was actually a nice change.

None of these are trying to be commercial games. They’re small projects that I can build, finish, and move on from. That’s part of what I like about them. I’d rather actually finish a small game than have ten half-built projects sitting in a folder somewhere.