Skip to content

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

packages/sim/src/water ​

Water and lava (a level's water: flat surfaces over rectangles, GAME_DESIGN §5.2).

A person in water wades, slowed, once it is over the knees, and swims once it is over the chest: the swimmer floats with the head out, moves slowly whichever way the keys say, cannot jump or fire, and walks out where the bottom comes up again. A fall into deep water hurts nobody. A car whose body sits in water (the surface over the bottom of its chassis: wading deep, afloat, flooding or sunk; not one splashing through a sheet shallower than that, vehicleInWater) neither smokes nor burns: its fire goes out and never starts (fire.ts), and the client draws no smoke over it. A car whose middle sinks under the surface floods: wrecked, its people put out into the water, it settles on the bottom (the water slows it). Lava kills whoever steps in and wrecks whatever drives in, and sets it alight.

Deterministic: the surfaces are the level's, and whether a body is in one is its pose.

Variables ​

Functions ​