Using scripts to define functions means that you can change the function just once when required and the change will be "picked up" by every object that has a call to the function. Script functions should generally be used if you have a block of code that you use in more than one place or object, or when you want a block of code to be used across multiple objects in a modular fashion. The functions you define in a script can resolve expressions, return values or do anything else that the GameMaker Language permits, just like the built in runtime functions. Script assets are essentially a collection of one or more user defined functions or variables that you write yourself as snippets of code in the Script Editor.
0 Comments
Leave a Reply. |