Skip to content

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

packages/sim/src/bascules ​

The bascule bridges (GAME_DESIGN §12, chaos event E2 "a raised bridge mid-chase"): each leaf of the level (LevelData.bascules) is a deck on a kinematic body that tilts up about the hinge at its back end. Raised (raiseBascule: the police's doing, at a wanted driver's approach, @foi/ai's chaos events; or a mission's, or a debug command), it tilts up to its angle over BASCULE.riseSeconds, stands raised for BASCULE.holdSeconds, and comes down as slowly. Two leaves facing each other open a gap in the middle as they rise; a car fast enough runs up one and jumps it (physics does the rest: a kinematic deck carries what stands on it, as a lift does).

Its angle is a pure function of the tick it began to rise and the tick now (basculeAngle), so the server, every client's prediction (the room's chaos message tells it when) and the drawing agree. The ticks are SimWorld.basculeSince (−1 lowered), hashed with the rest.

Variables ​

Functions ​