five-on-it / packages/world/src/lamps
packages/world/src/lamps
Where the level is lit at night: its street lamps (the placements of a lamp piece, the downtown kit's street-lamp and any piece named a lamp post), each lighting a pool of LAMP.reach metres round its foot. The AI sees further in that pool at night than in the dark (@foi/ai's visibility.ts), and the client draws the pools (night-view.ts). A lamp knocked down (a light piece lying loose, @foi/sim's breakables.ts) lights nothing: whoever asks says which lamps are out, by their placement. The lamps are sorted into a grid of LAMP.cell m once per level. Pure and deterministic.