Game Development Reference
In-Depth Information
Resource naming conventions
While working with GameMaker, you will begin to see how important it is to keep things
as organized as possible. Part of this is keeping resource names short and concise. If your
resource names are long and complicated, it can lead to ugly and confusing code later on.
Due to GameMaker having specific resources, it becomes easy to keep resource names
clean. The easiest and most commonly used way to keep names consistent and specific to
each resource type is to pick a code word or letter to put in front of the actual resource
name.
When looking at other GameMaker projects, you will see a few different implementations
of this. We are going to take a look at the three-letter code word technique. This is where
you pick a three-letter code word to put in front of your resource name. The code word
should be specific to each resource type. There is no need to stick to three letters. You can
use one, two, or more letters if you want to.
Here are some commonly used three-letter code words that are used:
•
spr
for Sprite
•
snd
for Sound
•
bck
for Background
•
pth
for Path
•
scr
for Script
•
shd
for Shader
•
fnt
for Font
•
tml
for Time Line
•
obj
for Object
•
rm
for Room
These are the most common abbreviations for three-letter code words. You might have no-
ticed that the code word for a room is only two letters. You can use three letters if you
want, but there is no need to do so for such a simple word.
Okay, so now that we have seen the code words, how are these structured into resource
names? You put the code words in front of your resource name, separated by an underscore
("_"). So for an object, it might be called
obj_player
, where
obj
is the code word. This
is the same for every other resource type.