Skip to content

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

packages/sim/src/step ​

One fixed step of a world: the weather read at the room clock (weather.ts), the ghosts' time counted down (griefing.ts), the systems in order (the nail strips unrolled or reeled in before the cars, nails.ts), the light pieces a fast car is about to hit knocked loose (breakables.ts), the physics steps (one, or as many as two bodies about to meet fast ask for: substeps.ts), the velocities going into them recorded and the cars' hits on people taken from them just after (car-hits.ts: the solver alone would carry a person on the bumper), the cars in water (sinking.ts) and the fires (fire.ts: a car brought low catches fire, burns and blows up), then the Rapier state of whatever can have moved is mirrored into the components, then the statuses (status.ts: a dart that puts its target to sleep, a loud noise that wakes a sleeper), then the mission items of whoever died dropped where they fell (loadouts.ts, where the game's rules say so). The same function runs on the server and inside the client for prediction.

Functions ​