© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2023
B. TyersGameMaker Fundamentalshttps://doi.org/10.1007/978-1-4842-8713-2_24

24. Functions

Ben Tyers1  
Worthing, West Sussex, UK

Using functions for code that is used often within your game is great way to make it easier to read and quicker to update. Additionally, it makes it easier to organize and understand how your code works. A GML function is also useful in processing data, especially if you will be doing the same calculation again and again. This can include sending data to the script, processing it, and returning an outcome or variable. If you are using the same code twice or more anywhere in your program, then you should consider using a function. ...

Get GameMaker Fundamentals: Learn GML Programming to Start Making Amazing Games now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.