-
Notifications
You must be signed in to change notification settings - Fork 0
Control Blocks
SittingFox edited this page Feb 17, 2015
·
2 revisions
These blocks manage the flow of control in a spell.

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.

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.


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.


orb.setInterval("function", variable);This calls a given function with a given delay before doing so, over and over until the spell is over.

orb.destroySelf();The orb is destroyed, ending the spell.