Skip to content

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

packages/sim/src/boarding ​

Getting in and out of cars at their doors (GAME_DESIGN §6.3), players and NPCs alike.

Getting in (the interaction key's Get in, Get in as passenger, Unlock: startBoarding): the character goes to the door of the seat it takes, the nearest of the seat's doors (seats.ts) a person can stand at (across the row, over the seats, when none is), running, round the car's nose or tail when the door is on the far side, facing the door as it comes up to it (and the way it runs round a corner); at the door it gets in for EXIT.inTicks, facing the door, and is seated: the time its enter clip takes, so nobody is at the wheel, and the car stands, until it is in. A carjacker gets in the same way where it stands, once its beat is over (getInAt). The seat is kept for it all the while. It gives up when the car is gone, wrecked or faster than a crawl, when the seat is taken, when it is knocked down, or when the door stays out of its reach for EXIT.reachTicks. Its input counts for nothing meanwhile: no steps, no shots.

Getting out by the interaction key (leaveVehicle), as the car's speed allows (exitMode): at a crawl it steps out at its seat's door (or at the nearest free spot along the car), facing out, and stands there for EXIT.outTicks; faster, up to the bail-out limit, it bails out: set down at its door (or behind the car, never in front of it) with the car's velocity and a push away from it, it tumbles to the ground (a knockdown, the longer the faster) and is hurt by the speed as a car hitting it at that speed would hurt it; faster still, it stays in. The dead (killed in their seat by a wreck's crash, its fire or its blast, damage.ts, fire.ts) stay in the car, slumped in their seat (deadInSeat): a body that stays, for good; anyone else until it comes back as the dead do. Off a two-wheeler, which holds nobody, the body falls once the machine has all but stopped, and whoever takes a car by force pulls its dead out (putOutDead); a two-wheeler blowing up throws its riders off at once, dead, with its speed (throwOff).

The acts (acts.ts) show it: board on the way to the door, enter getting in at it, exit just out of it. A client's twin knows no more than the act (boardCar is -1): it stands still and the snapshots move it.

Functions ​