Skip to content

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

packages/sim/src/spawners ​

The level's vehicle spawners (GAME_DESIGN §5.5, LevelData.spawners): parking bays where a car stands, of the spawner's class or of the next class of its mix, owned by nobody or an NPC, locked unless the spawner says not, its key the spawner's tag. Once the car is gone (driven more than SPAWNER's distance away, wrecked, removed), the next is put there the spawner's respawn seconds later, when the bay is clear (no car in it, nobody where the car would stand); never with a respawn of 0. A dormant spawner's car (a parked car: dormant.ts) dozes once it has settled in its bay, and its bay is refilled only out of sight, with no player within DORMANT.respawnRange of it. A wreck spawner's car stands wrecked, a derelict (fire.ts): it can be shoved and set alight, never driven; it is gone once it has burnt out or been shoved away. A boat's spawner stands on the water (the level's checks see to it): its boat is put afloat at its draught, moored where it floats, and dozes once it has settled, as a dormant spawner's car.

The server runs them, not the clients' prediction worlds (which never spawn anything: their twins come from the snapshots): startSpawners with the level, spawnerSystem every tick before the step. Their state is hashed with the world's.

Interfaces ​

Variables ​

Functions ​