ReferenceVerse

Lock And Door

lock and door

Updated
Watch the Knot — lock-and-door in ~90 seconds.

One step on the giant conch shell and the driftwood shore gate swings open to reveal the Seashell Shore treasure cove.

The lock device gives you full control over doors—you can Open, Close, Lock, or Unlock them for a specific agent, triggered here by a floor plate.

We declare the lock and trigger as editable fields, write a handler that unwraps the stepping agent, and subscribe to the trigger's event when the game begins.

Reach for the lock device whenever you need a door to obey your game's logic instead of just a basic key.

seashell_door := class(creative_device):
    @editable
    ShoreGate : lock_device = lock_device{}
    @editable
    ShellPlate : trigger_device = trigger_device{}
    OnStepped(Agent : ?agent) : void =
        if (A := Agent?):
            ShoreGate.Unlock(A)
            ShoreGate.Open(A)
    OnBegin<override>()<suspends>:void =
        ShellPlate.TriggeredEvent.Subscribe(OnStepped)

Build your own lesson with lock-and-door

Generate a personalized, compile-checked lesson grounded in this exact reference.

Build a lesson →