Home > SoulHow > SoulHow to get started with Game Maker

SoulHow to get started with Game Maker

May 30, 2008

NOTE: Comments are locked. I no longer answer questions about the Game Maker tutorials on this blog; I suggest you take any questions to the Game Maker Community. For more info, view the FAQ page.

Skill Level: New user (1)

I know I already posted a SoulHow Game Maker guide which included code, but I’d like to post one now about how to get started using the program. If you just downloaded the program or are now learning the basics, here’s how to get going. By the way, this tutorial is for game maker 7.0, though it pretty much applies to other versions too. If you don’t have the program at all, get it here.

Because this is an introductory guide, the only requirement is that you have a working copy of the program. I’m skeptical about how well the “let us look at an example” section of GM manual covers these basics, so I’m going to cover everything I can think of here. Read on, young Game-Maker-hopper! ( =P )

Mmkay, let’s get started by opening the program. Simple enough; after you installed it there should be a little game maker icon somewhere on your desktop or quicklaunch bar. Click it, and wait for the program to pop up. In case you’ve been dabbling before reading this tutorial, click the “new game” button on the top left. It looks like a little blank white page.

I’m going to now explain what everything is. Take special note of the bolded terms, because they will be important to remember.  Okay, there should be about 5 items in front of you with little folder icons (if there’s more, ignore the ones that I don’t mention for now) along with two more with different icons (don’t worry about these right now either). The folder-icons are: sprites, sounds, backgrounds, objects, and rooms, called “resources“. Together, they make up what’s called the resource tree. It’s a tree because as you will see, it branches off with each type of resource you create.

Anyways, two of these are self-explanatory. Sounds are sound effects, and backgrounds are the background you use for your game. The rest are a little less easy to figure out so I’ll explain them.

Objects are what make up the actual game. The character is an object, the enemies are objects, and even the ground is an object (or several objects put next to each other!). When you make an object in game maker, you’re telling game maker how that object should act.

Sprites are like graphics. You draw them yourself or load them into game maker and “insert” them into objects so the objects can look like something. Sonic wouldn’t look like a blue hedgehog if it weren’t for his sprite. In fact, he wouldn’t look like anything if he didn’t have a sprite.

Rooms are where your game happens. They’re like levels. Inside these rooms, go instances of objects you created. OMG what does instances mean???

When you make an object, you’re telling game maker how it should behave. But imagine you make an enemy, and you want to put two of it in the room. You don’t have to make the object twice; instead, you put two instances of the same object at different places in the room. Think of “objects” as cookie-cutters and “instances” as the cookies.  You can use the cookie cutter as many times as you could possibly want and get exactly the same cookie each time.

Okay, now let’s get to some demonstration. (A.K.A. fun time!) Click the “new sprite” button near the top of the window. It looks like a little red pacman facing right (like this: ). Suddenly, some mysterious new “limb” appears in our tree! This isn’t a ravenous plant eating monster, it’s actually your first sprite. Congratulations!

Now as you can see, a window has popped up, as will happen whenever you create new resources. The first thing to notice is the name box. Whenever you create resources, you MUST adhere to certain naming rules. Here they are:

  • Don’t start the name with a number.
  • You can use a number elsewhere in the name.
  • Don’t use spaces!!!!!!!!!!
  • You can use the underscore ( _ ) symbol to represent a space if you need to.
  • Don’t name two resources the same.
  • Do use prefixes to denote what kind of resource it is. (see below)

About these “prefixes”, they’re very important to maintain organization throughout your game. Get into the habit of doing this, because it’ll help you a lot later on. Here’s what I use (there are other possibilities, come up with your own if you don’t like mine):

  • Sprites: spr
  • Sounds: snd (for SFX) or mus (for background music)
  • Backgrounds: bck
  • Objects: obj
  • Rooms: rm

So for example, you might create a new sprite of Sonic the Hedgehog and call it sprSonic. Then you might make an object which tells GM what Sonic should do and you would call the object objSonic. That way, no two resources ever have the same name.  This is crucial so that Game Maker doesn’t ever mix up two resources that have the same name.

Now back to the sprite. Right now I just want to show you how everything works, so in the box that popped up when you created the new sprite (double click your sprite to get it again if you already closed it) click “load sprite” and search for a good sprite from the bunch that came with Game Maker when you installed it (in the “sprites” folder).  Finally click it to get it into the game. Change the sprite’s name to “sprMySprite” and click “ok” to close out.

Now let’s make an object to put the sprite in! Click the “new object” icon from the top bar just like you did with the “new sprite” icon, except this time it looks like a blue sphere (). A similar but different dialog box pops up.

This is your object box. It too has a name, and a few other fields and doohickeys.  One of these is labeled something you might find familiar: sprite.

This is indeed the place where you tell game maker what sprite instances of the object (cookies from the cookie cutter) should have to “represent” it. So click in that box, or on the button next to the box, and click on your newly created sprite when its name pops up.

The picture of your sprite appears next to the object. All good here; now let’s take a look at another part of the object: the events. The events are like the object’s veins; they tell the object when to do what. To demonstrate, you need to see what happens when you click “add event”. Click it now. A list of events will pop up. They are all connected to certain-goings-on when an object is being used in the game. For example, the create event (which has the icon) will occur when an instance of that object is created in your game, for example when the game starts or when you want a new instance of that object in your game. We’re starting with that one, so click it now.

It shows up in your event list. The event list shows events that mean something to the object; that is, events that actually tell the object to do something when they’re reached. In this create event we want the object to do something, so that’s why we need it on the list.

The next thing to learn about is actions (sometimes called Drag n Drop, or “DnD” for short). Actions are the blood of the object; they actually make the object do stuff. These actions are contained on tabs which can be seen on the right of the object box. The first one you’re going to learn about is on the move tab, and it’s called, “Start moving in a direction”. Click the move tab, if it isn’t already selected, and find the action that looks like this: . Right click it (or drag it onto the white space labeled “actions:”) and it appears in the second column, your actions list (labeled, “actions:”).

When it does appear on that list, your game knows that when an instance of that object is created, you want it to move in a direction. Now another window will pop up (getting old yet?); this one looks a little more entertaining, though. It has 8 arrows pointing in different directions. See, the game knows you want the object to move, but it can’t guess how you want it to move. You have to tell it. Like a butler. Only, not real.  And with arrows.

So click every direction. Don’t worry, this won’t overload game maker’s circuits. Instead, it tells game maker that you want the object to move in one of these directions, chosen at random. Seems good for a demonstration so just go with it for now.

Then there’s a textbox with the label, “Speed”. You have to tell GM how fast you want the object to move. No, it’s not miles per hour, so don’t go typing in 60. Instead, it’s pixels per frame, which is basically many, many times faster than miles per hour, or so it seems relative to your computer screen (there’s no such thing as a mile in the game world). So let’s put in a nice amount, like 8. That’s not too fast, and not too slow.

Click the “okay” button and the window disappears. But the action is still in the list. Success! The object will now pick a random direction and move in it with speed 8 upon creation (because the action is in the create event). Name the object “objMyObject” and click “okay” again to close this object box, because it’s time to actually show something on the screen!

Well, not quite. Sorry for lying. You have to put instances of this new object in the room. Click “new room” in the same way you did for the sprite and the object and a new room pops up on the resource tree just for you. It’ll also bring up a new window (what else is new, eh?) but this one’s a lot bigger. It’s really not that complicated if you stick to the basics for now, though. This window is called the room editor. It lets you put instances of your object in the room. Essentially, left click to place instances, and right click to delete them. It automatically has your latest object set up for creation, so click in the room and see your sprite appear where you clicked.

Make a few more, maybe about 10 or 12 total. When you’re done, you’re ready to run your first game! Click the little green “run” arrow near the top of the whole screen. Game Maker will disappear and your game will say it’s loading and will pop up. This is the room you just created. Game Maker takes the rooms you make and sets them in motion, so the events can fire and the objects can do stuff. You see all your objects fleeing off in different directions right when they’re created (as the room starts), just as you told them to. Press escape to go back into Game Maker.

And that, is a bare-bones explanation of how you use Game Maker. Experiment with creating more sprites and objects and try using different actions and events. For this, keep the GM manual handy, because I feel it explains everything else pretty nicely. Most of the other events are self-explanatory (some you should read up on), and actions can be discovered by just trying them out (or, again, by reading up on them in the manual). At least though you understand how Game Maker actually functions. I depart you now, hopefully having passed on some helpful insights. Good luck my friend.

If you enjoyed this article, please consider checking out the rest of the blog.

%d bloggers like this: