HTML & CSS Wiki
Advertisement

Game Maker Language is a scripting language developed for use with a computer game creation application called Game Maker. It was originally created by Mark Overmars to supplement the drag-and-drop action system used in Game Maker. However, in the latest versions, all the drag-and-drop actions translate to GML rather than being separate from it.

GML is heavily integrated with the Game Maker environment. Usually, elements such as sprites and sounds are all organized within the Game Maker IDE (though they can also be loaded from external files). Game Maker's architecture is designed to handle such things as event detection, level design, and object configuration without the need to code them manually, minimizing code verbosity with intuitive interface features.

A common misconception is that languages such as Pascal and C++ can be directly used in GML. This is incorrect, and is a common mistake due to GML's ability to utilise Pascal and C++ style syntax (e.g. "&&" is interchangeable with "and").

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 increment/decrement 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 ?: syntax. GML statements can be separated by semicolon, but Game Maker does not force this.


This page uses Creative Commons Licensed content from Wikipedia (view authors).
Advertisement