I've been making my way through several tutorials on GameMaker: Studio at this point, and I've been trying to keep track of various aspects of the code used in them. One thing, however, confused me.
I have noticed that it's possible to define new variables in GM:S either with or without using the var
keyword. I'm aware that you can use the var
keyword to define multiple variables in one line, for example var xx, yy;
(and, of course, defining null variables), but other than that, is there a particular reason why some variables don't need to use var
? Is it all to do with functionality, or what? When, in that case, should I use var
other than the example provided?