|
Naming |
|
When adding a sprite / sound / background / path / script / font / timeline or object, never ever leave it with the default name (sprite0, sound5, object14), while these might be alright while starting out with Game Maker, you'll soon find your list of resources growing and you'll soon lose track of what is what (what is object14? Is it the player? Is it a gun? is it a platform?).
It's best to start as you mean to go on, by naming your resources with meaningful names, for example object14 could be the player's bullet so a good name could be player_bullet, then you know at a glance what the object is supposed to be. But now this poses another problem, what is player_bullet? From what we've been discussing, it's fairly obvious that it's an object, but what if the sprite was also called player_bullet? or a sound called player_bullet? As you can imagine, it's all going to get confusing.
This is where prefixs come in, in order to distinguish one resource from another we place certain prefix's before the name of the resource, you don't have to do this, but it makes it a lot easier to see what is a sprite or object or any resource is that you're referring to in your code, here is a list of prefix's that I use, you can of course come up with your own prefix's or not use them at all:
Revision #1 |