Workboard Game
How the composite Workboard renders the game-style agent world
Workboard composes a game-style interactive map for agent activity. The atlas, room, inspector, and
pixel-sprite renderers are internal parts of that composition — they are not separate public
components, so you do not import them individually.
Game map config
The only game-specific value @downcity/ui exports is the map builder. Pass the same input the board
uses to derive a DowncityWorkboardGameMapConfig:
import { buildWorkboardGameMapConfig, type DowncityWorkboardBoardSnapshot } from "@downcity/ui";
const gameMap = buildWorkboardGameMapConfig({
board,
activeZoneId: "active",
selectedAgentId,
});| Option | Type | Meaning |
|---|---|---|
board | DowncityWorkboardBoardSnapshot | Current board snapshot |
activeZoneId | DowncityWorkboardZoneId | Zone to focus |
selectedAgentId | string | Currently selected agent |
The returned DowncityWorkboardGameMapConfig describes zones, actors, corridors, patrols, and points
of interest. Workboard builds it internally; call the builder directly only when you need the same
geometry for your own overlay.
Rendering the game
Render the board and let it own the game mode, HUD, zone navigation, and motion:
import { Workboard } from "@downcity/ui";
import "@downcity/ui/styles.css";
<Workboard
board={board}
selectedAgentId={selectedId}
onSelectAgent={(id) => setSelectedId(id)}
/>Public game types
These types are exported for configuring and typing the map. The atlas, room, inspector, and sprite renderers consume them internally.
| Type | Purpose |
|---|---|
DowncityWorkboardGameMapConfig | Full game map config returned by the builder |
DowncityWorkboardGameZone | One zone on the map |
DowncityWorkboardGameActor | One agent actor with position and route |
DowncityWorkboardGameRoute | Patrol or corridor path |
DowncityWorkboardGamePointOfInterest | Named point on the map |
DowncityWorkboardGameAreaLabel | Area label rendered on the map |
Related
- Workboard — the composite board you render
- WorkboardStage and WorkboardStageMap — the board's internal stage layers