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,
});
OptionTypeMeaning
boardDowncityWorkboardBoardSnapshotCurrent board snapshot
activeZoneIdDowncityWorkboardZoneIdZone to focus
selectedAgentIdstringCurrently 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.

TypePurpose
DowncityWorkboardGameMapConfigFull game map config returned by the builder
DowncityWorkboardGameZoneOne zone on the map
DowncityWorkboardGameActorOne agent actor with position and route
DowncityWorkboardGameRoutePatrol or corridor path
DowncityWorkboardGamePointOfInterestNamed point on the map
DowncityWorkboardGameAreaLabelArea label rendered on the map