five-on-it / apps/level-editor/src/scripts/blocks/door
apps/level-editor/src/scripts/blocks/door
Marks a node of the editor scene as a door: a panel standing on the node's origin (the middle of its doorway's floor), across the node's x (scaled to its width, height and thickness), turned with yaw only. The game builds it shut, swings it a quarter turn about its −x end away from whoever opens it with the interaction key, its collider with it; a lock (a tag such as key:door:office) keeps it shut for anyone without an item of that tag. Of the kind gate it slides aside along its width instead; of the kind barrier it is a car park's arm at the height the node is scaled to, lifted upright to open; both open by themselves for a car whose driver carries what opens them (a ticket for a barrier locked by one). The library's block:door carries it: place instances of that mesh for npm run level:export to read.