Skip to content

five-on-it / packages/world/src/level / RoadDef

Interface: RoadDef ​

Defined in: packages/world/src/level.ts:150

A road: its centre line as a polyline on the ground (or on whatever carries it, since every point has its height), width metres across, with lanes forward lanes running from the first point to the last and keeping to the right of the centre line, and lanesBack lanes running the other way (0 makes it one-way). A straight street is two points; a smooth bend is a polyline sampled every few degrees. Roads have no collider: they say where the streets are, for the AI drivers and the maps. Roads whose centre lines touch or cross join into the road graph.

Properties ​

kind? ​

optional kind?: "track" | "country" | "street" | "avenue" | "highway" | "lane"

Defined in: packages/world/src/level.ts:166

Its class, when a region's tiles laid it (tiles.json): a track, a country road, a street, an avenue, a highway; the game paints a highway's hard shoulders.


lanes ​

lanes: number

Defined in: packages/world/src/level.ts:158

Lanes running forward (at least 1).


lanesBack ​

lanesBack: number

Defined in: packages/world/src/level.ts:160

Lanes running the other way (0 = one-way).


name ​

name: string

Defined in: packages/world/src/level.ts:152

The node's name in the editor: for messages and a stable order.


points ​

points: [number, number, number][]

Defined in: packages/world/src/level.ts:154

The centre line, at least two points (m); the forward lanes run toward the last.


speed ​

speed: number

Defined in: packages/world/src/level.ts:162

Speed limit (m/s); 14 is about 50 km/h.


surface? ​

optional surface?: "dirt"

Defined in: packages/world/src/level.ts:164

What it is made of when it is not paved: dirt for an unpaved track (drawn brown, without markings); absent for a paved road.


width ​

width: number

Defined in: packages/world/src/level.ts:156

Width across (m).