Open source · MIT · No build step · Native ESM

Building-block code for browser 3D games

74 concise, self-explanatory modules across coordinate frames, actor motion, camera rigs, gameplay state, and world building — for coding agents to compose, adapt, and generalize from, instead of deriving fragile 3D behavior from scratch.

↑ This snake is driven by the real SnakeMotionController + SnakePlay modules · AI autoplay
74modules
7categories
3dependency tiers
MITlicense

Why GameBox

Natural language is a weak interface for precise 3D behavior. Prompts compress spatial transforms into tokens, and small ambiguities cause inverted directions, unstable motion, or state that no longer matches the screen.

GameBox turns fragile 3D and gameplay patterns into inspectable implementations with clear semantics. Instead of deriving behavior from scratch, agents generalize from these blocks to build spatially accurate 3D games.

Three dependency tiers · take what you need

Pure logic

Zero dependencies. Plain JS data structures that run straight in the browser.

three

Depends only on three.js — load it and render.

three + Rapier

Needs three, plus a Rapier physics world injected at runtime.

7 categories · 74 modules

Browse by capability. Every module is tagged with its dependency tier and relative path.

How it works

GameBox is source material, not a framework to install — copy the modules you need into your project, preserving the relative directory structure.

1

Ground everything on WorldBasis

Use modules/math/WorldBasis.js as the single source of truth for gameplay-space coordinates: forward/right/up axes, planar movement, heading, and control transforms.

2

Select modules from the catalog

Browse the catalog and prioritize existing modules whenever possible — especially motion controllers and camera rigs.

3

Copy into your project, keep structure

Copy selected modules preserving their relative directory structure so imports keep working. Reuse as-is if they fit; adapt in place if partial — don't rewrite from scratch.

4

Document the usage

Create gamebox_usage.md listing the selected modules, their purpose, reuse/adaptation status, key changes, and integration.

Install as a local skill

Copy gamebox into your coding agent's skills folder so it's discovered automatically when a task involves browser-based 3D game development.

Codex
  1. Clone the repository locally
    git clone https://github.com/shushuitie2017/GameBox
  2. Copy into the skills folder
    mkdir -p ~/.codex/skills/gamebox && cp -R gamebox/. ~/.codex/skills/gamebox/
  3. Invoke

    In the Codex chatbox type /gamebox or $gamebox, or let it load automatically when the task matches.

Claude Code
  1. Clone the repository locally
    git clone https://github.com/shushuitie2017/GameBox
  2. Copy into the skills folder
    mkdir -p ~/.claude/skills/gamebox && cp -R gamebox/. ~/.claude/skills/gamebox/
  3. Invoke

    In the Claude Code chatbox type /gamebox, or let it load automatically when the task matches.

Community

Scan the QR code to join the GameBox open-source community.

Community

The WeChat group QR code expires periodically. If it no longer works, leave a note in GitHub Issues to get the latest invite.