Skip to content

How a web game works

Four ideas are behind every web game. Read them together. You don’t need to remember them.

A game is made of code: text that tells a computer what to do. Claude writes it. The code lives in your game’s repository, a folder on GitHub.

A laptop on a desk shows the code as rows of coloured bars, and the bars flow into a yellow folder.
The code is the game’s instructions, kept in its repository.

GitHub keeps a copy of your game on its computers, at a web address. This is called hosting. When a friend opens the address, their browser fetches the game and runs it.

A small server house on a floating island sends a dotted path of light to a tablet and a phone, which both show the same dragon game.
The computer that hosts the game sends it to every device that opens its address.

Your player and best scores are saved in the browser of the device you play on. Many apps use a database, a store on a server. Games from the starter template have none. So a save on the tablet is not on the laptop.

A tablet with an open treasure chest of gems beside it, and a laptop on its own cloud with no chest.
The save stays on the tablet it was made on. The laptop has its own.

Claude never changes your game straight away. It makes each change on a copy, called a branch. You read what it changed, together. If you like it, you merge it: one button on GitHub adds the change to your game. A minute or two later, it is on the web.

A path carries the game along. A purple side path branches off to a workbench and joins the main path again at a glowing check mark.
A change is made on a branch, then merged back into the game.
How a game gets builtYour game's code lives in a repository on GitHub. Claude makes a change on a branch, a copy for trying things. You look at what it changed. A pull request asks to add the change. While it is on the branch, your game does not change. The merge adds the change to the main game. GitHub then publishes it in a minute or two, and the game is live at its address.RepositoryYour game's code, on GitHubYour game does not change yetBranchClaude makes a change on a copyYou look at itClaude says what it changedPull requestAsks to add the changeMergeAdds it to the main gameNow your game changesGitHub publishes itIn a minute or twoLive at its addressyour-name.github.io/dragon-dash
Start making your game

Next: what you need, and the steps to your first game.