Skip to content

five-on-it / apps/client/src/renderer/heli-view

apps/client/src/renderer/heli-view ​

The police helicopter as the game draws it (GAME_DESIGN §12 at seven stars, the simulation's FLYER_CLASSES[POLICE_HELICOPTER]): a low-poly helicopter in the police's navy with a white band, a dark canopy, skids, a tail boom with its fin, a main rotor of four blades turning in a see-through blur and a tail rotor spinning on its side, a red and a blue strobe on its back blinking in turn. Shot down, a burst of sparks goes off at it, its rotor runs down and it spins round as it falls, rolling over; its wreck lies charred where it came down.

Its searchlight is drawn while the snapshot says it is on (a flyer's inside is how far out over the ground the pool of light is, in decimetres, its aim which way: poolCentre): a pool of light on whatever is under it (a disc that adds its colour to the ground's, brighter in its middle) and a faint cone from the lamp under the nose down to it. No light of the scene's is added: nothing else's shader changes, and it costs two draws.

It cruises 35 m over the roofs, higher than the camera, which looks down from 30 m over the player: drawn there it would never be seen. So it is drawn no higher than CEILING_SHARE of the camera's height over what it looks at (drawnHeight), and see-through while it hangs right over that point (overheadFade), so the player under it stays in sight; its shadow, its pool of light and everything the simulation does with it are where it truly is.

Between two snapshots it is carried on by its velocity and its corrections eased away, as a drone is (drone-view.ts).

Interfaces ​

Variables ​

Functions ​