🎮 Build Real Games in JavaScript

Three classic arcade games, built from scratch — by designing them first and choosing the code for each piece yourself.

The rule of this guide: you will never be handed a finished game to copy. Copying code teaches you to copy code. Planning a game and picking your tools teaches you to build any game.

The three games

👻 Pac-Man

Steer through a maze, eat every dot, dodge four ghosts. Teaches tile maps, solid walls, and chase AI.

🦍 Donkey Kong

Climb the girders, jump the barrels, reach the top. Teaches gravity, jumping, and platforms.

🐟 Fishy

Eat fish smaller than you and grow; dodge the bigger ones. Teaches spawning, size, and endless play.

Where to start

  1. Start here

    The big idea, and a two-minute setup. You'll write your games at play.kaplayjs.com — nothing to install.

  2. Learn the planning method

    The seven building blocks every 2D game is made of, and the six-step method you'll use on all three games. Do this before you write any code.

  3. Pick a game and open its workbook

    Each workbook walks you through designing the game, then gives you a build order of small milestones you can test one at a time.

Your tools

🧰 Technique Playground

Fifteen coding techniques, each with a live example you can run right in the page — then open in the real editor with one click. This is where you go when a workbook says "find the technique for that".

📋 KAPLAY Cheatsheet

Every command, searchable. Keep it open in a tab while you build. Includes a "Stuck? Fixes" section for the bugs everyone hits.

▶ KAPLAYGROUND

Where you actually write your games. Code on the left, game on the right. Set the version picker to 3001.0.19 to match this guide — and hit Share or Download before you close the tab.

📚 Full KAPLAY docs

The complete API reference, for when you want a command this guide doesn't cover. Good coders look things up constantly.