Top Down Strategy
examples/top-down-strategy is a maintained starter, not a promised future sample. It
ships a bright construction-grid environment, six animated units, an orthographic camera,
click and marquee selection, formation orders, separation, pushable physics cubes,
automatic doors, roof reveal, and a React HUD.
Open it
Section titled “Open it”- Hosted: open Top Down Strategy in the editor.
- Editable copy:
npx @vgai/cli@latest create my-strategy --example top-down-strategy.
In an engine checkout, vgai edit examples/top-down-strategy opens the maintained source.
Source shape
Section titled “Source shape”src/world.tsxis the thin entrypoint.src/scenes/StrategyScene.tsxowns the replaceable composition.src/prefabs/contains independently placeable, story-backed objects.src/components/contains supporting implementation that is not a prefab.src/data/tuning.data.jsoncontains values intended for quick live tuning.src/ui/is a separatedomroot with portable Storybook states.
Gameplay stays in R3F hooks and direct ecosystem libraries. There is no component registry or scene sidecar: component props are authorable configuration, and the game shares a small module state store with its React HUD.
Controls
Section titled “Controls”- Click or drag to select units.
- Click open ground or right-click to issue a formation order.
- Pan with WASD or the arrow keys.
- Zoom with the mouse wheel.
See Navigation and Worlds and roots for the underlying contracts.