five-on-it / packages/sim/src/lifts
packages/sim/src/lifts
The ground that moves: the level's lifts and escalators (GAME_DESIGN §5.5).
A lift is a platform on a kinematic body that rides up and down between its stops on a fixed timetable: from its lowest stop up through each to its highest and back down through each, standing LIFT's dwell seconds at every one, travelling at its speed. Its height is a pure function of the level and the tick (liftHeight), so the server, every client's prediction and the drawing agree with no state on the wire, as the traffic lights do; liftSystem moves the bodies to the tick's heights before each physics step, and whoever stands on a platform rides it.
An escalator is a flight of stairs whose hidden slope carries whoever stands on it up or down its length at ESCALATOR's speed (movingGround).