ANTIGRAVITY / smoosh-patrol Open IDE GOOGLE ANTIGRAVITY Building 3D Worlds with Voice & Agents How we co-authored and compiled a live 3D sandbox game using natural language | +  Gemini 3.5 Flash (High) Local 01 // 12 SMOOSH PATROL DEV DECK NEXT →
SYSTEM ARCHITECTURE
02 // 12
Client-Side Runtime & Generative Orchestration
  • Dynamic JIT Injection: Structural 3D model arrays are generated as abstract syntax nodes by Gemini and executed on-the-fly inside the active WebGL rendering pipeline via client-side contextual evaluation.
  • Stateful Frame loops: Leverages a non-blocking window.customTicks event queue to inject custom animation frames, proximity colliders, and collision listeners without disrupting the main thread.
  • Go Proxy Middleware: A specialized local Go router handles API transport, sanitizing payload variables and proxying client rate limits to prevent budget overflow.
  • JSON Schema Enforcement: Restricts response models to structured formats, mapping verbal specs into immediate WebGL positioning vectors.
CLIENT: THREE.JS RUNTIME WebGL Render Canvas Scene graph / camera loops Physics & State Managers Speed vectors / collision arrays window.customTicks [] Frame-rate hooks / active zones Dynamic JIT Injector Evaluation of dynamic JS payload Speech Recognition API Verbal speech transcription BACKEND: GO PROXY Static Asset File Server API Gateway Proxy GEMINI LLM ENGINE Structured Generation (JSON) Code Generation Pipeline
MEET THE DEVELOPER
03 // 12
Lead Developer Gemma
Click to Reveal
Lead Developer
THE DEVELOPER
04 // 12
Voice-based Coding

Meet Gemma.

Gemma is five years old and built the entire 3D game using Antigravity voice commands.

  • Zero Syntax barriers: She did not write a single line of JS, HTML, or CSS.
  • Intent-Based specs: Spoke directly to the Antigravity agent to dictate environment visual elements, speed boosts, space navigation, and mechanics.
  • Iterative Design: Insisted on physics behaviors like "going higher in space" and "feeling lighter" on the Moon.
| +  Gemini 3.5 Flash (High) Local
Imagination Amplified by AI
GAMEPLAY DEMO
05 // 12
Gameplay Visual Demo
Live 3D Gameplay compiled by Voice
ITERATIVE DESIGN
06 // 12
The pacing of a child's imagination

"I want it to do whatever I want."

Gemma's gameplay session was an endless stream of quick ideas. She wanted to test new physics models, custom colors, and animal shapes on the fly.

  • Endless Iteration: From a basic cop car to space flight, to moon gravity, and pop-on-impact balloon collision networks.
  • The Laptop Bottleneck: Since the Antigravity voice engine ran inside the developer IDE, Gemma had to hog her dad's laptop to build and testโ€”completely locking him out of his own computer.
1. Cop Car Baseline
"spawn a cop car"
2. Space Flight
"make me fly to space"
3. Tiger Mode
"turn the car into a tiger"
4. Stateful Score Loops
"add colorful balloons"
THE PIVOT
07 // 12
The Laptop Offload

"Why don't we put Gemini directly inside the game?"

Bypassing the developer workspace bottleneck. Offloading the compiler loop from the programmer's laptop directly into the player's running runtime canvas.

๐Ÿ’ป Dad's Laptop IDE (Blocked) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โžฆ ๐ŸŽฎ In-Game Voice HUD (Free)
THE TRANSLATION ENGINE
08 // 12

How child-like spoken commands are compiled into fully mathematical WebGL assets and game loops in real-time. (Click each card to reveal).

1. Intent Capture

Web Speech API captures verbal intent in real-time, outputting subtitle transcript tracks.

"Make the cop car a tiger"

2. Code Generation

Gemini compiles spoken transcripts against schemas, compiling JIT-ready JavaScript blocks.

{ say: "Roar!", js: "..." }

3. WebGL Scene Injection

Context-safe dynamic evaluation directly modifies active Three.js memory graphs on-the-fly.

eval(compiled_js)
UNDER THE HOOD
09 // 12
The Generated Code

A look at the actual code generated programmatically by the agent when Gemma commanded: "Turn the car into a tiger."

// 1. Clear original cop car meshes
while(window.carGroup.children.length > 0) {
  window.carGroup.remove(window.carGroup.children[0]);
}

// 2. Build tiger body
const body = new THREE.Mesh(
  new THREE.BoxGeometry(1.6, 1.0, 3.2),
  new THREE.MeshStandardMaterial({color: 0xffaa00})
);
window.carGroup.add(body);

// 3. Re-inject stripe loops on the back...
for(let i = -1; i <= 1; i++) {
  const stripe = new THREE.Mesh(...);
  window.carGroup.add(stripe);
}
STATEFUL INTERACTIVITY
10 // 12
Living Sandbox Loops

Gemma wanted interactive logic. We enabled the AI to hook directly into the Three.js render frame loop, creating self-updating scene structures.

  • window.customTicks: A global array executing custom code injection layers on every render frame.
  • Proximity Colliders: Live distance checks triggering events when player coordinates intersect zone boundaries.
  • Dynamic CanvasTextures: Vector billboards (like the glowing "CAR WASH" sign) drawn onto 2D canvas buffers and mapped onto 3D meshes in real-time.
STATEFUL PHYSICS DEBUGGER fps: 60
PROXIMITY ZONE (R < 10m) WASH
eval() loop
"If distance < 10, spray water assets and replace custom tiger textures back to police paint code."
LIVE DEMO
11 // 12
Let's Play
๐ŸŽ™๏ธ ๐Ÿฏ ๐Ÿš€ ๐ŸŒ•
Live Sandbox Demo Visual
THE NEW DEVELOPER ERA
12 // 12
Paradigm Shift

From Writing Code to Orchestrating Intent

Gemma's sandbox game shows that the barrier to entry is goneโ€”a five-year-old can voice-program a 3D simulation. For us, our role shifts from typing repetitive boilerplate to auditing agent code paths and defining architectural boundaries.

๐Ÿ“‰
Lower Floor Building software is accessible to anyone with a voice.
๐Ÿ“ˆ
Higher Ceiling System complexity limits expand exponentially.
๐Ÿค
Co-Creation Collaboration shifts to directing agent systems.