I guess?
- Try to make your code look like the rest of the code: four-space indentation,
snake_case
, curly braces around control blocks. I'm not going to throw a fit of scripts don't begin withscr_
or anything but try to give resources names that group them together with similar resources easily - Generally accepted Game Maker coding standards are appreciated: giving script arguments meaningful names at the top of scripts (except in constructor-like scripts) (I still have a ton of old code that doesn't really do that - don't be like that) and using
true
andfalse
to mean "true" and "false" instead of1
and0
- Avoid magic numbers when possible, although in some cases it's probably not actually worth the trouble
- Until the 2020 GML update comes along,
script_execute
is the answer to object-oriented programming - In Game Maker,
n < 0.5
evaluates false andn >= 0.5
evaluates true. You may take advantage of this fact when checking for the presence of anull
value: the keywordnoone
equates to-4
,undefined
is a special falsey value and-1
is often used to represent an invalid index in a list. (In fact, I encourage you to do so, becausevalue != noone
checks everywhere make the code more dense and arguably harder to read.) However, do not do this when checking actual numbers against each other. Note:0
may be a perfectly valid index in a list but is falsey, so if you want to abuse the truthiness of a list or array index you must instead checkindex + 1
. - I'll add more to this later maybe