HouseDoor
A door leaf that swings on its own hinge. It is what stands in the doorway of every room in the house, so a doorway reads as shut rather than as a hole.
game.house.HouseDoor
A door leaf that swings on its own hinge. It is what stands in the doorway of every room in the house, so a doorway reads as shut rather than as a hole.
HouseBuilder attaches it to each door_<id> leaf, with the door's lock.
Who opens it
Not this component. It owns the swing and the lock data; the systems
slice owns the interaction — whether the player holds the key, what the
prompt says, and the message when a door refuses. The systems slice sets
open = true when the player may pass. So the house never has to know about
inventory, and the inventory never has to know about hinges.
Fields
| Field | What it is |
|---|---|
open | Whether the leaf is swung aside. Sync — a door one player opens is open for everyone. |
lockedBy | The GameRules.ITEMS id that opens it, or "". Empty means it is never locked. |
swing | How far the leaf turns, in degrees. |
hinge | Which edge it turns about, 1 or -1. |
width, axis | The leaf's size and which way its width runs, so the hinge can be found from them. |
speed | Degrees a second while it swings. |
The hinge is the whole problem
A door is a box, and a box turns about its own centre — which swings the leaf
straight through both walls. So the leaf's position is carried around its hinge:
the hinge sits at one edge, and opening is that point staying still while the rest
of the leaf travels around it. awake finds the hinge from the leaf's position,
width and axis; every frame of the swing re-derives the position from the closed
one, so a door that is interrupted halfway still ends exactly shut or exactly open.
Scoped to this part · feeds back into the world's score.