five-on-it / apps/client/src/renderer/lit-windows
apps/client/src/renderer/lit-windows
Which windows light at night, and where they are (GAME_DESIGN §5.7). Two things, both pure:
- Where: windowsOf finds the windows of a level mesh in its glass (the kits'
glass,glass-lightandwindowcolours): every upright rectangle of glass wide and tall enough to be one, the face that looks out of the building (a window is a slab proud of its wall: the slab's back, buried in the wall, is no window), a band or a wall of glass cut into windows of a room's width and a storey's height. - When: a share of the windows is lit by the hour (litShare: most in the evening, few at three in the morning, none by day; a shop's front through its opening hours), and each window is in it or not by a hash of its placement, its index and the night (isWindowLit), so the same window is lit for every player of a room at the same hour, and another night lights other windows. Its light is one of a few tones (windowTone: warm mostly, a few cold, a television's blue that flickers slowly, tvFlicker).
window-lights.ts draws them.