ReferenceVerse

Indentation Matters

indentation matters

Updated
Watch the Knot — indentation-matters in ~90 seconds.

A diver hits a dropped net in the kelp shallows, getting tangled while the water keeps rippling for everyone else.

In Verse, indentation replaces curly braces, so those four spaces tell the engine exactly which lines belong inside your condition, and which run no matter what.

We indent the trap message under the agent check so it only fires for the diver, while dropping the bubble message back to the method's base indent lets it run for the whole ocean.

Reach for exactly four spaces, never tabs, whenever you need to build the walls of your game logic.

net_trap := class(creative_device):
    @editable
    DroppedNet : trigger_device = trigger_device{}
    OnStepped(Agent : ?agent) : void =
        if (A := Agent?):
            Print("Caught in the net!")
        Print("Water ripples...")
    OnBegin<override>()<suspends>:void =
        DroppedNet.TriggeredEvent.Subscribe(OnStepped)

Build your own lesson with indentation-matters

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

Build a lesson →