Keywords
| this | the button this script is attached to (button scripts only) |
-- these all refer to the button itself:
hide button this
show button this
move this right by 40 in 1 seconds
if this is visible
Navigation
| go next | next card |
| go prev | previous card |
| go first | first card |
| go last | last card |
| go card <name> | card by name |
| go card <n> | card by number |
go card card_b
go card 3
Sound
| play sound <name> | play a sound |
| wait until done | pause until sounds finish |
| wait <n> seconds | pause for n seconds |
play sound click
play sound beep
play sound chime
play sound whoosh
play sound drum
play sound glass
-- play a sound then go next after it finishes:
play sound glass
wait until done
go next
-- wait 2 seconds then go next:
wait 2 seconds
Button Visibility
| show button <nameId> | make visible |
| hide button <nameId> | make hidden |
show button myRedBtn
hide button myRedBtn
-- hide the button that was clicked:
hide button this
Button Animation
| move <id> <dir> by <n> in <secs> | slide button |
| dir: left right up down |
| n: pixels or % of size |
-- slide right 40px over 2 seconds:
move this right by 40 in 2 seconds
-- slide left 50% of button width:
move this left by 50% in 1 seconds
-- animate then go next:
move this up by 100 in 0.5 seconds
wait until done
go next
-- hide self after playing sound:
play sound click
wait until done
hide button this
Effects
| trigger effect <name> | visual effect |
trigger effect shake
trigger effect flash
trigger effect wobble
trigger effect negative
Dialogs
| say "text" | show message, OK button |
| ask "prompt" | text input → answer |
| yesno "question" | Yes=1, No=0 → answer |
-- simple message:
say "Level complete!"
-- text input:
ask "What is your name?"
name = answer
-- yes / no:
yesno "Play again?"
if answer == 1
go card start
end
Control Flow
| stop | halt script |
| -- text | comment line |
Variables (numbers)
Define in {} Variables panel. Reset each play session.
score = 0
score = score + 10
lives = lives - 1
damage = attack * 2
if score > 100
go card bonus
end
if lives == 0
go card game_over
end
Arithmetic: + - * / (one op per line)
Compare: > < >= <= == !=
Variables (strings)
-- assign string (no quotes needed in panel)
name = "Alice"
greeting = "Hello " & name
-- string equality
if name == "Alice"
go card secret_room
end
-- & concatenates; + also works for strings
label = "Score: " & score
Mixing number + string in >/< comparisons shows an error in the message bar.
Text Objects
Text objects on a card are named text_1, text_2, etc. (shown as badges in editor).
-- set text content
text_1 = "New content"
text_2 = score
text_1 = "Score: " & score
-- read text content into a variable
msg = text_1
-- use in condition
if text_1 == "done"
go next
end
Conditionals
Blocks end with end. Optional else branch.
if this is visible
play sound whoosh
hide button this
else
play sound glass
show button this
end
if card is card_a
go next
end
if card is not card_z
go next
end