Skip to content

Control Blocks

SittingFox edited this page Feb 17, 2015 · 2 revisions

Control Blocks

These blocks manage the flow of control in a spell.

On Create

On Create block

function onCreate( orb ) {

}

When the spell starts, the orb is created. It is from here that the spell you write begins. This function is only called once.

On Activate

On Activate block

function onActivate( orb ) {

}

This is triggered when the activate key (F by default) is pressed, however many times it is pressed. This is useful for telling a spell to start doing something else at your command.

Call Function

Call Function block

Call Function block, filled in

orb.setTimeout("function", variable);

This calls a given function with a given delay before doing so. This is good for repetitive calls, where no delay would cause the game to slow down.

It should be noted that other operations will not wait for this to be carried out.

Repeat Function

Repeat Function block

Repeat Function block, filled in

orb.setInterval("function", variable);

This calls a given function with a given delay before doing so, over and over until the spell is over.

Destroy Orb

Destroy Orb block

orb.destroySelf();

The orb is destroyed, ending the spell.

Clone this wiki locally