GML Syntax and Semantics
GML is structurally similar to C-based languages in its use of code blocks, function calls, variable assignments, operator syntax, and so on.
GML makes a difference between statements and expressions. For example g < 1;
is not a valid statement and GM will return an error. Also, variable assignment is always a statement in GM, and cannot be used in an expression.
GML also allows common compound assignment operators. For example, the code
g += 1;is the same as
g = g + 1;The same function applies to the operators -=
, *=
, and /=
.
Game Maker does not allow ternary operators(?: syntax). Semicolons can be used to separate logical lines, but Game Maker does not enforce this.
Also Game Maker does not allow ++ and -- instead of +=1 and -=1.
Read more about this topic: Game Maker Language