Skip to content

five-on-it / packages/world/src/signals / buildSignals

Function: buildSignals() ​

buildSignals(level, graph, junctions?): Signals

Defined in: packages/world/src/signals.ts:183

The signals of a level: every traffic light piece assigned to the junction nearest to it (within SIGNAL_REACH; a light farther from every junction rules none), the approaches of each signalled junction split into two groups (along the first incoming lane's axis within 45°, or across it), each light showing the group of the incoming lane nearest its signal head, and each junction's plan shifted by its own offset.

Parameters ​

level ​

LevelData

graph ​

RoadGraph

junctions? ​

readonly Junction[] = ...

Returns ​

Signals