Skip to content

Prop injection

import { Aside } from ‘@astrojs/starlight/components’;

A merchant arrives at the tavern tile with three crates of trade goods. You want the crates rendered on the tile, queryable by AI, and removable when the merchant leaves.

import { spawnGameboardPlacement } from 'declarative-hex-worlds/koota';
const crateA = spawnGameboardPlacement(world, {
tileKey: '2,4',
assetId: 'crate_A_big',
kind: 'prop',
layer: 'prop',
metadata: { ownerActorId: 'merchant:trader-7' },
});
  • Placement spawn. Adds the koota entity with IsGameboardPlacement + PlacementOnTile + PlacementState traits.
  • Footprint check. Asserts the prop fits within the tile’s available footprint slots.
  • Query surface. Consumer can later findGameboardActor(world, ...) to locate the merchant + iterate their placements.