Math FAQ (Game Maker)

This FAQ describes answers many questions about how math is handled in Game Maker.

General

What does var1 += var2 mean?

It is shorthand for :

var1 = var1 + var2;

What does var1 -= var2 mean?

It is shorthand for :

var = var1 - var2;

How do I increment (add one to) a variable?

var = var + 1;

or

var += 1;

How do I decrement (subtract one from) a variable?

var = var - 1;

or

var -= 1;
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution 2.5 License.