Coding conventions
In order to write effective code, regardless of programming language, it is important to follow the recommended coding conventions. This will help ensure that other people can read and understand what the code is attempting to do and debug it. There is no universal standard for programming practices, though many languages follow similar guidelines. The GameMaker Language (GML) does not have an official recommended set of conventions, partially due to the fact that it was developed to be a learning tool and is very forgiving as a result.
For this book, we will define our own conventions based on common practices and ease of learning.
All assets, except Rooms, will start with a simple type signifier and an underscore. For example:
Sprites:
spr_
Objects:
obj_
Scripts:
scr_
Even though it is possible to use the Execute Code DnD to write code directly on an event, all code will be placed into Scripts and the naming convention will indicate the Object it is attached to and the Event...