GameMaker Studio, developed by YoYo Games, is a popular engine for creating 2D games. Its built-in programming language is known as GameMaker Language (GML). GML is designed to be accessible for beginners but also provides enough complexity and flexibility for more experienced developers.
GML includes dynamic typing, meaning variables do not need a specified data type and can change types as needed. Basic data types include strings, numbers, arrays, and more.
GML provides a range of functions that can be used for various tasks such as manipulating sprites, handling user input, and managing game states. Control structures include if-else statements, switch cases, loops, and more.
In GameMaker, objects have events such as Create, Step, Draw, and Destroy, which are triggered during the game's lifecycle. You write GML within these events to define an object's behavior:
GML interacts with GameMaker's resource system, which includes Sprites, Sounds, Objects, Rooms, and more. The programming language ties the logic to these resources for gameplay functionality.
For the more advanced users, GML supports scripts (reusable functions), data structures, surfaces, shaders, and DLL extension functions for added capabilities.
Understanding GML requires learning its syntax, functions, and how it integrates with GameMaker's event-driven model. It's a powerful tool, enabling a wide range of game development possibilities.