How to build a multiplayer 3D browser game with Claude Code
Use an engine whose whole API fits in one file your AI assistant can read, and that already handles rendering, physics, characters and multiplayer. The GrowBlocks Dev Kit is built for this: run npx growblocks new my-game, open the folder in Claude Code and describe your game. Claude reads the API, writes game.js, plays the game headless, looks at a screenshot and fixes what is off.
Multiplayer rooms, hosting and phone controls come with the engine, so you do not set up a server.
Why AI assistants struggle with game engines
An AI coding assistant writes good game logic, but it trips over three things: APIs it half-remembers (it invents functions), boilerplate it has to get exactly right (renderer, loop, physics world, networking), and not being able to see the result. Most engines were designed for humans in an editor, so all three bite.
GrowBlocks was designed the other way round. The whole API is one plain-text file, llms.txt, written for AI assistants ("use only what it documents"). The renderer, camera, physics and game loop already exist when your code runs. And the starter kit includes a checker that opens the game headless and hands back every error plus a screenshot, so the assistant can see what it built.
Step 1: create the game folder
You need Node.js 18 or later.
npx growblocks new my-game
cd my-game
npx growblocks dev # play it at http://localhost:5173/play.html
The folder contains game.js, the instructions an assistant reads by itself (AGENTS.md, CLAUDE.md), the full API (llms.txt, gb.d.ts types), a checker (check.mjs) and .mcp.json, which gives Claude Code and Cursor the GrowBlocks tools.
Step 2: describe the game to Claude
Run claude in the folder and describe what you want. A prompt that works:
Make a multiplayer [your idea] game on GrowBlocks. Check it with a screenshot
and fix anything that's off, then push a test build and give me the link.
Through the MCP server Claude can call growblocks_docs, growblocks_check (which returns the screenshot), growblocks_blocks and growblocks_add_block, growblocks_push, growblocks_status and growblocks_submit. Outside the starter folder, add it with claude mcp add growblocks -- npx -y growblocks mcp.
Step 3: what multiplayer looks like in code
This is a complete multiplayer game: a sunset world, a floor with physics, a box you can knock over, your character, and everyone else in the room drawn as theirs.
export default async function game(gb){
gb.world.style('sunset');
gb.world.ground({size:60});
gb.world.box({size:[1,1,1], position:[0,4,-4], color:'#ff5fa2', physics:'dynamic'});
gb.player.spawn({position:[0,1,6]});
const room = (await gb.net.join()).showPlayers();
}
gb.net.join() puts the player in a room on the GrowBlocks match server (up to 16 players per room, then a new room opens). Rooms carry messages (room.send, about 40 a second per player), shared state that late joiners receive (room.state), and a host that moves automatically when the host leaves. The server relays and does not simulate, so the pattern is: the host decides shared outcomes such as scores and spawns, everyone else draws them.
Step 4: make it work on phones
Read input through gb.input.move and gb.input.action and phones get a touch stick, a JUMP button and an ACT button automatically. For named buttons that change label in play (SHOOT becomes DUNK near the rim), use gb.input.touchControls. Gamepads work through gb.input.pads.
Step 5: put it online
npx growblocks login # once: confirm a code in your browser
npx growblocks create my-game --name "My Game"
npx growblocks push # uploads a test build, prints its link
npx growblocks submit # sends it to GrowBlocks for review
A test build gets an unlisted link you can share with friends straight away. Going live needs GrowBlocks' review, and every update is reviewed too. Hosting is free within the limits in llms.txt (30 MB per build, 3 MB per file).
When this is the wrong choice
The engine is licensed for games published on GrowBlocks only. You cannot export a GrowBlocks game to Steam, an app store or your own server, and you cannot self-host the engine. Your game code and art stay yours (terms).
It is also a JavaScript and three.js world: if you want C#, a visual editor or native console builds, Unity or Godot fit better.
Questions people ask
- Do I need to know how to code?
- No, but it helps. Claude Code writes, runs and checks the game for you. Knowing a little JavaScript lets you steer it and fix small things yourself.
- Can I use Cursor or another assistant instead of Claude Code?
- Yes. Cursor picks up the same MCP server from .mcp.json. A chat assistant without file access can work from https://growblocks.xyz/devkit/llms.txt and return game.js for you to save.
- Do I need to run a multiplayer server?
- No. gb.net.join() uses the GrowBlocks match server. Rooms hold up to 16 players.
- Does it cost anything?
- The Dev Kit, hosting and multiplayer are free. GrowBlocks reviews games before they go live.
- Which engine does it use underneath?
- three.js for rendering and Rapier for physics, plus GrowBlocks characters. Your code can reach gb.scene and gb.physics.world directly.
Try it in five minutes
npx growblocks new my-game
Open the Dev KitPlay the games
Keep reading
- A three.js game framework with characters, physics and multiplayer built inthree.js is a renderer, not a game engine.
- Browser game engines compared: GrowBlocks, three.js, Babylon.js, PlayCanvas, GDevelop and RosebudA plain comparison of engines for 3D games in the browser in 2026: three.js, Babylon.js, PlayCanvas, GDevelop, Rosebud AI and the GrowBlocks Dev Kit, by what each one gives you and who it suits..
- A Unity alternative for small web gamesFor small 3D games that should load fast in a browser and work on phones, a web-native engine is often a better fit than a Unity WebGL build.