Comparisons : Equals, Greater Than, Less Than
These nodes compare their child nodes, and if the condition is met, the changedTrue event fires. For instance, if we want an event to occur after exactly 5 button clicks, we can use a conditional to see if the counter is equal to 5.equalTo
equalTo (when(changedTrue,
print("ok, 5 clicks is enough! you can stop now.")))
{
value counter()
value (value(5))
}
wandTrigger(when(button1,counter.increment))
greaterThan
greaterThan (when(changedTrue,
print("you've pressed the button more than 5 times! that's too many!")))
{
value counter()
value (value(5))
}
wandTrigger(when(button1,counter.increment))
(c) Ben Chang