Legacy GM Why use scripts & draw events/ what are the uses?

T

TheRBZ

Guest
This is one of those shower thoughts, but why should I use a draw event for drawing things? Are draw events executed by the GPU? Same goes for scripts, why use them when you can use the step event?
I don't know....
By the way, I am a rather amateur GameMaker: Studio'er. Don't judge me.
 

Tornado

Member
Scripts are used to organize your code. Otherwise you'll have spaghetti code which is harder to read and maintain. So you break pieces of code that do some clearly defined task into modules (in this case scripts).
The advantage is also you can call those scripts then from many places instead to code the same thing in EVERY place. If you dont need completely the same functionality from different places, but slightly different, you still can call the same script which will have some parameters, so in the script according to parameters you can do slightly different things.
 

Jezla

Member
why should I use a draw event for drawing things?
Because all of the "draw_*" functions work only in the Draw Event. If you're content with the game displaying all of your sprites and backgrounds as-is, then you don't need to use the Draw Event. If you want to display anything in a special fashion, add other effects, or draw text, you'll have to use the Draw Event. See the manual on the Draw Events.
 
Top