Skip to content

five-on-it / apps/client/src/renderer/car-lights

apps/client/src/renderer/car-lights ​

The cars' lights on the road at night (GAME_DESIGN §5.7): every car on screen that somebody drives (not parked, not a wreck; the player's own among them) throws its two headlights ahead, each a soft cone of light on the ground from its lamp, widening and thinning over CAR_LIGHTS.length metres, and leaves a faint red glow on the road behind its tail lamps. A two-wheeler has one headlight, a bicycle and a trailer none. The patches lie on the ground where it is (the ground probe under the nose, at the beam's far end and under the tail, so a beam climbs a hill with the road) and follow the car's drawn pose. All of them are thin instances of one mesh whose colours are added to the picture: one draw call however many cars, on the software renderer too. Nothing is drawn, nor worked out, by day.

Interfaces ​

Variables ​

Functions ​