stormFrontKit.package
README.md
stormFrontKit.swallow
What a zone (an island, a platform, a bridge: any entity named in the front's zones, or whose
name starts with zonePrefix) does when the storm front swallows it, and what goes with it. Five
effects, picked with the StormFront field swallowEffect (or per zone with the attribute
stormFrontKit.swallow): fall (darkens, shakes, drops away tumbling), sink (darkens and
slowly sinks out of sight), darken (fades to black and stays, consumed), shatter (bursts into
chunks cut from the zone's bounds that fly apart and fall), dissolve (crumbles from the edge
inward into dust while it shrinks); none only fires the event. Swallow.resolve(name) maps
other names (crumble, break, fade, drop ...) to these.
A zone carries every descendant, every entity marked stormFrontKit.zone = "<zone name>", and
(carry on, the default) every other entity standing in its footprint up to carryHeight above its
top that is not a player, runner, camera, spawn, storm front, other zone, global light or
something wider than the zone (Swallow.standsOn is the rule). stormFrontKit.noCarry = true
opts an entity out.
Every peer plays the same show at the same moment: effects are timed from the shared progress
(update(progress, dt, speed) starts a zone first seen behind the front at the moment it was
really swallowed) and every random choice is seeded from the zone's name. settle(progress, speed) skips zones whose show is already over straight to their end state (late joiners, jumps);
restore() puts every zone and everything it carried back (reset, loop). A synced entity owned
by another peer is left for its owner to move.
Swallow.new({ carry, carryHeight, selfId }), setZones(list), update, settle, restore,
swallowedCount(), carriedNames(zoneName).