Recent changes Random page
GAMING
Gaming
 
WoWWiki
Diablo Wiki
Fallout-The Vault
Grand Theft Wiki
Halopedia
StarCraft Wiki
FFXIclopedia
Resident Evil Wiki
See more...

Function

From Game Maker

Jump to: navigation, search

A function has the form of a function name, followed by zero or more arguments between brackets, separated by commas.

<function>(<arg1>,<arg2>,...)

There are two types of functions. First of all, there is a huge collection of built-in functions, to control all aspects of your game. Secondly, any script you define in your game can be used as a function.

Note that for a function without arguments you still need to use the brackets. Some functions return values and can be used in expressions. Others simply execute commands.

Note that it is impossible to use a function as the lefthand side of an assignment. For example, you cannot write instance_nearest(x,y,obj).speed = 0. Instead you must write (instance_nearest(x,y,obj)).speed = 0.

[edit] See Also

Rate this article:
Share this article: