Skip to content

five-on-it / packages/sim/src/flyers

packages/sim/src/flyers ​

Things that fly (GAME_DESIGN §12: the police's surveillance drone at five stars; the helicopter, a drone swarm and the player's scout drone are classes still to come): an entity each on a kinematic body that the simulation moves from its input, as a car's input drives a car. The input is the horizontal velocity the flyer asks for and the height it asks to fly at (setFlyerInput, written by the AI); the flyer comes round to it within its class's acceleration, top speed and climb rate (FLYER_CLASSES), facing the way it goes. Nothing it meets stops it (the AI picks a height over the roofs) and nothing meets it: its collider is in no group a body, a wheel or a person collides with, but a shot's ray finds it, so it is shot like anything else, its class's hit points. Shot down (downFlyer) it falls with gravity, its way through the air slowing, to whatever scenery is under it (a roof, a deck, the street; never a car or a person) and lies there as a wreck until whoever owns it takes it away (removeFlyer). The snapshots carry every flyer (kind flyer), and a client's world keeps a twin of each, a proxy the snapshots place (setFlyerTwin), so the targets on its player's line of fire are the server's. Deterministic: the flyers go in ascending id order, their state and their input are hashed with the world.

Interfaces ​

Type Aliases ​

Variables ​

Functions ​