This section explains the various assignments available.

An assignment simply stores a value in a variable and has the form:

<variable> = <expression>;

An expression can be a simple value but can also be more complicated, so, rather than assigning a value to a variable, one can also add a value to the current value of the variable using +=, for example:

a += b;

Similarly, you can subtract it using -=, multiply it using *=, divide it using /=, or use bitwise operators using |=, &=, or ^=. You can also add or subtract one from a value using ++, --.

Back: GML Overview
Next: Expressions
© Copyright YoYo Games Ltd. 2015 All Rights Reserved