In other languages when you work with a function, it is written...
public void funcion_ejemplo(int variable1, int variable2){
// la función trabaja con las vaiables que reciba
}
So when I want to use this function I would call it and send it data, like this:
funcion_ejemplo(12,5);
In this way I send variables to this function so that it is executed with different variables.
Now at GameMaker we have the Scripts, which we call:
Create_bomba();
. Is there a way to send variables to this script? . In case you don't find a way, I was thinking of creating global variables, and that the scripts use these global variables
The case of scripts is similar to functions... but not the same.
As stated in the documentation , scripts can take arguments:
Free translation by me:
If we continue reading, we come to the key point:
My translation:
That is, the arguments are accessed in a somewhat special way. The language incorporates 15 predefined variables to access them:
There are more things about the arguments: built-in variable
argument
, functionargument_count
, ... I refer to the documentation .