Skip to content
Browse documentation

Build your first game

Go from a starter kit to a playable browser game on your computer. Bring your own editor or coding agent.

View Markdown
On this page

Before you start

You need Node.js 24 or newer, pnpm 12, and a code editor. You can download a kit and build locally without a SpawnKit account.

Choose your starting point: Create with the CLI, download a kit below, or upload an existing browser game. Building with an AI agent? Follow the Codex, Claude Code, or Cursor guide. Use the dashboard guide when you are ready to manage a hosted game.

Check your tools
node --version
pnpm --version

If either command is missing, install Node.js and pnpm before continuing.

1. Choose a starting point

Each kit includes TypeScript source, a small playable scene, local development tools, and a production build. Not sure where to start? Choose Phaser for a simple 2D game. You can edit every part of the game.

KitStart here for
PixiJS2D sprites and a lightweight rendering foundation.
Phaser2D games built around Phaser scenes.
Babylon.js3D games with Babylon.js rendering.
Three.js3D scenes built with Three.js.
Phaser + Arcade PhysicsA 2D starting scene with movement and collisions.
Three.js + RapierA 3D starting scene with a dedicated physics engine.

Download the ZIP from a kit page and extract it into a new folder. Open the extracted project folder containing package.json in your editor. Use the kit builder if you want to choose your own combination of tools.

2. Run the game

Open a terminal in the project folder, then install its dependencies and start the development server.

Terminal · inside your game folder
pnpm install
pnpm dev

Open the local address printed in the terminal. In the starter scene, use the arrow keys to move and collect gold. Leave the terminal running while you edit; stop the server with Ctrl+C.

3. Make it yours

Start with one visible change: update the heading in index.html, save it, and check the browser. Then open src/main.ts to change the scene, artwork, or game behavior.

File or folderWhat it controls
src/main.tsThe entry point for your chosen rendering engine.
src/Game logic and any selected simulation modules.
public/Static artwork, audio, and other game assets.
spawnkit.config.tsThe title, description, and media for your game listing.
package.jsonInstalled dependencies and available commands.
AGENTS.mdProject instructions for your coding agent.

Working with an agent? Open the project in your agent and have it read AGENTS.md before editing. For the reusable create, extend, and publish workflow, see Agent resources.

4. Check the game and build

Run these checks before sharing a build. Curated kits include browser-based Vitest tests; Chromium only needs to be installed once on each machine.

Terminal · check and build
pnpm lint
pnpm test
pnpm build

A successful build creates dist/, the files your players will load. Keep the pnpm-lock.yaml created during installation so future installs use the same resolved dependencies.

  • Play through the starter scene and check movement and scoring.
  • Resize the browser and check that the game stays usable.
  • Check the browser console for errors.
  • If you chose a custom kit, run only the test scripts included in its package.json.

Ready to share? Follow Publish your game to upload your browser build.

If something gets stuck

What you seeWhat to try
pnpm or node is not recognizedInstall the required tool, reopen your terminal, and check its version.
The local address does not openKeep the development terminal running. Run pnpm exec dev-domains doctor, or use pnpm exec vite for a plain local server.
Tests cannot find a browserRun pnpm test:setup, then retry pnpm test.
The page is blankCheck the terminal and browser console. Confirm you opened the development URL, rather than opening index.html directly.

Need a hand? Get support

Explore the guides

Build your first game

Download a standalone game kit, run it locally, and make your first change.

Create and build a game with @spawnkit/cli

Start in a parent folder, generate your game, then run every development command inside the new game folder.

Upload an existing browser game

Upload a self-contained browser build. Your original source, engine, and build tools can stay as they are.

Publish your game

The dashboard accepts a ZIP of your built game. You will need an account to deploy it.

Use the SpawnKit dashboard

The dashboard manages your hosted games. Your editor or AI agent remains where you change and build your game source.

Make a browser game with Codex

Use Codex with a standalone TypeScript game kit. Start with a working scene and improve it one playable change at a time.

Make a browser game with Claude Code

Use Claude Code with a standalone TypeScript game kit. Start with a working scene and improve it one playable change at a time.

Make a browser game with Cursor

Use Cursor with a standalone TypeScript game kit. Start with a working scene and improve it one playable change at a time.

Extend your game

Find the right files, make a focused change, and check it in a playable build.

A complete publishing example

Follow a small example from editable source to a ZIP with index.html at its root. Use your own game title, description, and artwork.

Add tools to an existing game

Keep a recoverable baseline, inspect the proposed changes, and verify one addition at a time.

Test and debug your game

Combine automated checks with a short playthrough of the production build. A successful build alone does not verify gameplay.

Project structure and configuration

Your downloaded kit is a standalone TypeScript project. Its files belong to you and do not depend on the SpawnKit repository.

SpawnKit CLI reference

A command-by-command reference to the implemented CLI. Local generation works without an account; hosted operations require access to a project.

Accounts and access

Building locally is account-free. Publishing requires an account with access to the target project.

Agents and API resources

Public discovery endpoints are account-free. Use the dashboard or @spawnkit/cli for publishing.

16 guides available