five-on-it / packages/ai/src/police-drones
packages/ai/src/police-drones
The police's surveillance drone (GAME_DESIGN §12, five stars, "The Eye"): one over each player whose stars ask for it (police-ladder.ts), a flyer of @foi/sim's flyers.ts that the AI flies the way it drives a car, by writing its input: the velocity that keeps it on station above and behind the player (behind the way they go; standing still, where it was, a few metres off, so it never hangs straight overhead where no gun points), at its cruise height over the roofs under it and under the player. It only watches: while nothing solid stands between it and the player (a roof, a deck, a tunnel, an arcade; a ray from it to them, droneSees), the player is seen (police.ts): the Heat does not cool and the sighting goes out on the radio. It is slower than a fast car on a straight, so it can be outrun; it can be shot down (its hit points, FLYER_CLASSES), which is a crime and an escalation (wanted.ts), and its wreck lies where it fell a while; another comes later. When the stars drop it flies off, up and away. The tells are the client's: its buzz, its blinking light, its shadow on the ground. Deterministic: players by stars then client id, the drones in the order they were sent.