Working with AI
An agent builds the RPG
The whole Village Gate tutorial, done by one script or one agent prompt, with a play-test that checks it worked.
This page does the Village Gate tutorial for you, two ways. Both were run against a clean editor session before publishing.
Option A: one paste
- Open editor.trisgine.com (it needs a build with Assets > Import…) and wait for it to finish loading.
- Open DevTools (F12), then Console.
- Paste the contents of agent-build.js and press Enter.
It imports the four textures (with their UUIDs), the three scripts into Assets/Scripts, and
VillageComplete.tgscene, then opens the scene and logs a report:
[village-gate] built {
textures: ["Assets/Textures/rpg-grass.png 7A11C0DE00000001", …],
scripts: ["Assets/Scripts/VillageCoin.tgscript", "Assets/Scripts/Gate.tgscript", "Assets/Scripts/Villager.tgscript"],
scene: ["Assets/Scenes/VillageComplete.tgscene"],
loaded: {current: "Assets/Scenes/VillageComplete.tgscene", …},
entities: ["Player","Sun","Ground","House","Villager","FenceLeft","FenceRight","Gate","Coin1","Coin2","Coin3"]
}Press Play and walk through the gate.
Option B: one prompt for a browser agent
Give this to an agent that can control Chrome and run JavaScript in a tab (Claude in Chrome, a Playwright MCP server, and so on):
Option C: the agent builds it from scratch
Want the agent to author rather than import? Combine the scene system prompt and script system prompt with:
Expect a few rounds: the agent reads the compiler's line-numbered errors and fixes them itself.
What we measured
From the run that validated this page, with the player walking north from z = −14:
| Event | Player position when it happened |
|---|---|
| villager hops | z ≈ −6.9 (≈ 4 m from the villager) |
| gate opens | z ≈ 1.6 (≈ 4.4 m from the gate) |
| first coin collected | z ≈ 10.6 (≈ 1.6 m from the coin) |
All three scripts loaded, with zero refusals.