# Three.js Game Development with AI — Build and Play Web Games Next to the Chat

AI Game Developer now creates Three.js web games, runs them in a live game panel beside the chat, and lets the AI agent see, play and test them.

_Last updated: 2026-11-15_

AI Game Developer, our desktop app with a built-in AI agent, now supports a new engine: Web (Three.js). You can create a three.js game from the app, the command line or simply by asking the agent, and the game runs in a live panel right next to the chat. The agent does not only write the code: it can look at the running game, press keys, take screenshots and run playtests, so the loop of "change something, look at it, fix it" happens in one window.

This post explains what the Three.js support does, how a new project starts, and how you and the agent work on the same running game.

## Three.js Game Development with AI

Three.js is one of the most popular 3D libraries for the web. A three.js game is a web page: TypeScript code that builds a scene, a camera and a frame loop, served by a development server and played in a browser. That makes it a great fit for working with an AI agent. Every change is plain code, the page reloads in a moment, and the game can be opened anywhere a browser runs.

What usually gets in the way is the setup around the code: installing the right Node.js, creating the project, starting the dev server, and then copying screenshots and error messages back into the chat. AI Game Developer takes care of that part, so the conversation can stay about the game itself.

## Create a Project with a Starter Scene

There are three ways to create a Web (Three.js) project, and they all produce the same thing: a three.js + Vite + TypeScript project with nothing extra in it. The agent adds libraries when the game needs them.

- In the desktop app, open the create project dialog and pick Web (Three.js).
- In the AI Game Developer CLI, run the create command shown below.
- In any chat, ask the agent to create a three.js game; it uses the same create step.

```bash
/create-project threejs my-game --starter island
```

Every new project starts from a starter. Empty is a blank white page with a canvas, a scene, a camera and the frame loop, ready for your own idea. Four sample scenes give you something good-looking to build on: Studio, a glossy knot on a lit pedestal; Blueprint, a machined part drawn on blue paper; Checker, a checker floor with axes and simple shapes; and Island, a low-poly floating island at dawn. Each sample says at the top of its code what to replace with your game and keeps its tunable values in one settings object, so you and the agent know where to start.

[Media: The sample starters: Studio, Blueprint, Checker and Island]

Already working in Unity, Godot or Unreal Engine? The app can create a web prototype inside that project, in a WebPrototypes folder that the engine does not import. It is a quick way to try a mechanic in the browser before you build it in the main game.

## Node.js Is Provisioned for You

A web game needs Node.js and npm. You do not have to install them. The app downloads its own Node.js from nodejs.org, checks it against the published SHA-256 checksum and keeps it in its own folder, separate from any Node.js already on your machine. It does this in the background soon after the app starts, so the first game usually starts without waiting for a download.

When you or the agent run npm inside the project, it is the app's npm with the app's settings. If you work behind a corporate proxy or a private registry, the relevant settings from your own npm configuration (registry, proxy, certificates and credentials) are carried over, and other settings are left out.

## Play the Game Next to the Chat

Press Play in the title bar, or on the project in the Projects panel, and the game starts. While it starts, one progress card shows each step: the Node.js check, installing dependencies when they changed, and starting the dev server. Then the game opens in the game panel beside your sessions.

[Media: The Studio starter running, rendered with three.js]

The game panel is a real browser view of your running game, with a toolbar for reload, pause and frame step, mute, an FPS counter, and pop-out. Click into the game and it gets the keyboard; press Esc to give the keyboard back to the app. A pop-out puts the game in its own window, which is handy on a second monitor, and you can also open it in your usual browser. You can open the panel from the project menu or with Ctrl+Shift+G (Cmd+Shift+G on macOS).

Edits hot-reload. When the agent changes a file, Vite updates the page in place, and there is nothing to restart. If a change does not compile, the page keeps the last good build and the agent sees the compile error.

## The Agent Can See and Drive the Game

This is the part that changes how working with an AI feels. When the agent connects to a Web (Three.js) project, it gets a set of live game tools:

- Status and logs: the open pages, the frame rate, console output, uncaught errors with stacks and compile errors.
- Screenshots of the game canvas after a rendered frame, so the agent sees what you see.
- The three.js scene tree and any values the game chooses to expose, without extra game code.
- Input: keyboard, mouse, wheel, touch and gamepad, plus pause, step a number of frames and change the time scale.
- Playtests: a scripted sequence of input, frame steps, checks and screenshots that ends in one PASSED or FAILED report.

So you can ask for something like "make the jump higher, then check that the player can reach the second platform", and the agent can make the change, play the level with real input, look at the result and tell you what happened. For tests it can open hidden views, even several at once, so a test run does not take over your screen.

## Play on Your Phone

A game that runs in the app can also be played on a phone paired with the app through its remote link. While the game runs on your computer, the phone shows Play for the project, and the game streams over the same encrypted link the remote connection already uses: no local network setup, port forwarding or public URL. The agent can drive the phone view too, with input and screenshots, which is useful for checking touch controls.

## Multiplayer When You Need It

None of the starters has a server, because most games do not need one at first. When yours does, every new project includes a multiplayer skill for the agent: a small reviewed scaffold with a WebSocket relay server and a client, plus the steps to wire it into the game. The app runs that game server next to the game, restarts it if it crashes, and serves it from the game's own address, so it also works from a phone.

## Get Started

Download AI Game Developer from ai-game.dev/download, create a Web (Three.js) project with the Studio or Island starter, press Play and ask the agent for your first change. The app guide at ai-game.dev/docs/app covers installing the app and signing in. If you prefer native engines, read the companion posts about Bevy at ai-game.dev/blog/bevy-game-development-with-ai and BRUTAL at ai-game.dev/blog/brutal-dotnet-game-development-with-ai.

Image credits: the scenes in this post are the app's own starter scenes, rendered with three.js (MIT License, Copyright 2010-2026 three.js authors).

## Related

- Download the app: https://ai-game.dev/download
- The AI Game Developer App: https://ai-game.dev/docs/app
- Bevy game development with AI: https://ai-game.dev/blog/bevy-game-development-with-ai
- BRUTAL .NET game development with AI: https://ai-game.dev/blog/brutal-dotnet-game-development-with-ai
- The AI Game Developer workspace: https://ai-game.dev/blog/ai-game-dev-workspace-panes-previews-git

---

Source (HTML): https://ai-game.dev/blog/threejs-game-development-with-ai
