Voxel Game Maker

Docs Quick code

The same without code

Building the same behaviour from script nodes, and which node matches which code.

Most of what code does with objects and loops can also be built from nodes alone — no typing. The Sample Village's Sliding block (no code) shows it:

Event (player presses E) → Move object (+2 X, 1 s, wait) → Wait 1 s → Send object home (1 s)
  → Loop (3 times) ─Repeat→ Move object (+0.5 up, 0.2 s) → Move object (−0.5, 0.2 s) ─┐
         ↑──────────────────────────────────────────────────────────────────────────┘
         └Done→ End
Event (it bumps into something: player) → Play sound → Show popup "Bonk!"
Code Node
wait(2) Wait node
self.move(dx, dy, dz, s) Action ▸ Move object (Which: this object / named / tagged; Wait till there)
obj.move_to(x, y, z, s) Action ▸ Move object to
obj.go_home(s) Action ▸ Send object home
obj.turn(deg, s) Action ▸ Turn object
obj.hide() / obj.show() / obj.remove() Action ▸ Hide object / Show object / Remove object
obj.play("wave") Action ▸ Play animation
obj.say("Hi") Speech bubble action
for i = 1, 3 do … end Loop node: Repeat a number of times
while CONDITION do … end Loop node: Repeat while… (any condition)
while true do … wait(1) end Loop node: Repeat forever (with a Wait inside)
if CONDITION then … else … end Condition node (Yes / No)
if chance(30) then Random node
self.touching("enemy") Condition This object is touching
self.can_move(1, 0, 0) Condition Way is clear
if is_night() then Condition It is night
particles("explosion") Action ▸ Particle effect
x = x + 1, if x >= 3 Actions Add to counter, Condition Counter at least
choice("…", ["Yes", "No"]) Choice node
run_script("id") Action ▸ Run script
on_message("name", fn) Event: A message is sent
object("door") Which: The object named… + its Script name

Loop nodes: whatever hangs off Repeat runs, and the last node of that branch connects back into the Loop's input; when the loop is finished it carries on from Done. The problems line warns if the Repeat branch never comes back, or if a forever loop has no Wait (or a move that waits) inside. A run that goes through 20,000 nodes without waiting is stopped, with a message in the Output panel.

Moves in Triggers: the object actions also work in Trigger behaviors and dialogues, but there Wait till there is ignored — the glide starts and the next action follows at once.

Nodes and code mix freely: a Code node is just another step in a chain, and code can start node chains (run_script, send).