En poursuivant votre navigation sur ce site, vous acceptez l’utilisation d’un témoin de connexion (cookie), afin de réaliser des statistiques de visites et de personnaliser votre navigation. Pour en savoir plus, cliquez ici.
At its core, GameMaker Studio 2 is a complete 2D game development IDE. The GameMaker Language (GML) is the proprietary, interpreted scripting language that powers it. Originally created by Mark Overmars, it has been evolved and refined by YoYo Games to provide a bridge between user-friendly visual tools and professional-grade code.
GameMaker Studio 2 offers two distinct ways of writing game logic: and GML Code .
: Accessible across any object in any room, declared using the global prefix or a globalvar declaration (e.g., global.player_score = 0; ). Conditional Statements GML handles logic through standard conditional blocks:
At the heart of any programming language lies the concept of variables. In GML, a variable is a named storage location in memory that can hold different kinds of information, such as numbers, strings, boolean values, or references to more complex data structures. gamemaker studio 2 gml
Accessible by any object, anywhere, at any time during the game session. Ideal for universal data like game settings, player scores, or inventory systems. Declared using the global. prefix or a globalvar block. global.current_score = 0; global.game_paused = false; Use code with caution. Macro Variables
Runs every single frame of the game (usually 60 times per second). Used for movement, input detection, and core game logic.
An is a blueprint. It contains all the code and settings for a game entity, like a player, an enemy, or a bullet. An Instance is a specific copy of that object that exists in your game room. At its core, GameMaker Studio 2 is a
Defined inside an object, unique to that specific instance, and accessible across all its events.
// Typically initialized in the Create Event hp = 100; max_hp = 100; player_name = "Hero"; Use code with caution. Global Variables
Modern GameMaker utilizes lightweight JSON-like structs. Use them alongside arrays to handle inventory data or RPG stats cleanly, bypassing rigid data structures like DS maps. GameMaker Studio 2 offers two distinct ways of
Use semantic prefixes to identify scopes immediately (e.g., _local_var with an underscore, global.global_var , o_object_id ).
In GameMaker Studio 2, you write code in three places:
Choosing the correct scope ensures data security and proper memory management: