Skip to content

five-on-it / packages/catalogue/src/city/spec

packages/catalogue/src/city/spec ​

The level spec of the city template (version 1): a city drawn freely, as Riverbend is, written as data. Its streets are roads of six classes drawn through points, splines by default, that start and end on each other, at a roundabout's arm, on a grid's lines or along a river's bank; turned grids lay out a quarter's streets; rivers cross the map (a road over one gets a bridge); hills rise outside the town (a road ending at a hill's top climbs it); districts take the lots nearest their seed, each built and dressed in a style (styles.json, Riverbend's thirteen quarters); parks, greens and squares are areas. solve.ts resolves it into a plan or says, at its path, what it cannot build.

Everything is in the game's frame and in metres: a point is [x, z] with x growing westward (east is −x) and z northward, the map's middle at [0, 0]; a bearing is a compass's (0 north, 90 east). See The city spec.

Type Aliases ​

Variables ​