Dragonfly Cloud is now available on the AWS Marketplace - Learn More

Question: Does GameMaker use Python?

Answer

GameMaker Studio primarily uses its own scripting language called GameMaker Language (GML) for game development. GML is designed specifically for GameMaker and shares some similarities with languages like C and JavaScript, but it is not Python.

However, it's possible to use Python or other programming languages for certain tasks within a GameMaker project by using external libraries or DLLs and interfacing them with GML. This typically involves more advanced programming and an understanding of both GML and the external language being used.

For example, you might write a Python script that performs complex calculations or handles certain data processing tasks, then compile it into a DLL. You could then call this DLL from within your GameMaker project using GML with functions like external_define and external_call.

Here's a simplified example of how you might interface with a hypothetical Python DLL in GML:

// First, you define the external function var handle = external_define("MyPythonDLL.dll", "PythonFunction", dll_cdecl, ty_real, 2, ty_real, ty_real); // Then you call the external function var result = external_call(handle, argument0, argument1); // After you're done with the function, you free the handle external_free(handle);

In the hypothetical code above, "MyPythonDLL.dll" is the compiled Python library, "PythonFunction" is the function defined within the DLL, dll_cdecl signifies the calling convention, ty_real is the return type, and there are two arguments each of type ty_real passed to the Python function.

Keep in mind that interfacing with external languages adds complexity to your project and should only be done when necessary or beneficial to your workflow.

Was this content helpful?

White Paper

Free System Design on AWS E-Book

Download this early release of O'Reilly's latest cloud infrastructure e-book: System Design on AWS.

Free System Design on AWS E-Book

Switch & save up to 80% 

Dragonfly is fully compatible with the Redis ecosystem and requires no code changes to implement. Instantly experience up to a 25X boost in performance and 80% reduction in cost