Skip to content

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.

In an engine checkout, vgai edit examples/top-down-strategy opens the maintained source.

  • src/world.tsx is the thin entrypoint.
  • src/scenes/StrategyScene.tsx owns 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.json contains values intended for quick live tuning.
  • src/ui/ is a separate dom root 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.

  • 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.