Functions

Functions take something in the brackets and give a number or some text back.

FunctionWhat it does (from NutHouse’s ƒx helper)
Random(…)Random(10) gives a whole number from 0 to 9
Abs(…)Abs(-5) gives 5 (removes the minus sign)
Min(…)Min(3, 7) gives the smaller number, 3
Max(…)Max(3, 7) gives the bigger number, 7
Floor(…)Floor(2.7) rounds down to 2
Ceil(…)Ceil(2.1) rounds up to 3
Round(…)Round(2.5) rounds to the nearest whole number, 3
Sqrt(…)Sqrt(9) gives the square root, 3
Str(…)Str(42) turns a number into text "42"
Val(…)Val("42") turns text into the number 42
Len(…)Len("hello") gives the number of letters, 5
Left(…)Left("hello", 2) gives the first letters, "he"
Mid(…)Mid("hello", 1, 3) gives "ell"
Distance(…)Distance(X("Hero"), Y("Hero"), X("Ghost"), Y("Ghost")) gives how far apart they are, in pixels
Angle(…)Angle(X("Hero"), Y("Hero"), X("Ghost"), Y("Ghost")) gives the direction (0 to 31) from the first point to the second
Global(…)Global("A") is global value A, which keeps its number from level to level

Still stuck?

Try the Chocobreak tutorial, open a sample game and read its rules, or look at the questions people ask.