Voxel Game Maker

Docs Cookbook

Lever puzzle

Place two levers. What is it? ▸ Switch (Lever); set their Switch name to `lever_a` and `lever_b`.

#Without code

  1. Place two levers. What is it? ▸ Switch (Lever); set their Switch name to lever_a and lever_b.
  2. Place the gate. What is it? ▸ Door, Opens with a switch. For one lever that's all.
  3. For both levers: on the gate add a Trigger (Advanced) with When a switch turns on (lever_a), If Switch is on lever_a and Switch is on lever_b, Then Open / close a door (Which this object, To open).
  4. Copy that Trigger with a switch turns on lever_b, so either order works.
  5. Otherwise: Show popup "Something clicks...".

#Quick code

Where it goes: a level script, Event: Player enters the world.

wait_until(function()
  return switch_on("lever_a") and switch_on("lever_b")
end)
object("gate").move(0, 3, 0, 1.5)
banner("The gate opens!")