GML Overview

GameMaker: Studio has its own proprietary programming language called the GameMaker Language (abbreviated to GML).

The GameMaker: Studio programming language, GML, gives you much more flexibility and control than the standard actions that are available through the Drag'n'Drop interface. There are a number of different places where you can use this language to create and control your game:

In this section we will describe the basic structure of GML functions and how they are used to create your own programs and generally control your games. Please note that before programing in GameMaker: Studio there are a few conventions that you should follow! First of all, for all your resources (sprites, objects, sounds, etc...) you must use names that start with a letter and only consist of letters, digits and the underscore '_' symbol (for example "spr_Fish" is acceptable but not "spr Fish" or "6fish") otherwise you will not be able to refer to them with any GML functions. Also, make sure all resources have different names (there is a function in the Scripts section of the main IDE that can check this for you), and do not name resources self, other, global, or all because these have special meaning in the language.

Information on the GML language can be found in the following pages:

  1. Code
  2. Variables and Variable Scope
  3. Addressing Variables in Other Instances
  4. Data Types
  5. Arrays
  6. Functions
  7. Assignments
  8. Expressions
  9. Accessors
  10. The "If" Statement
  11. The "Repeat" Statement
  12. The "While" Statement
  13. The "Do" Statement
  14. The "For" Statement
  15. The "Switch" Statement
  16. The "Break" Statement
  17. The "Continue" Statement
  18. The "Exit" Statement
  19. The "With" Construction
  20. Scripts
  21. Comments in Code
  22. Evaluation Order


Back: Reference
© Copyright YoYo Games Ltd. 2018 All Rights Reserved