Professional Documents
Culture Documents
This tutorial is meant to get you started with Game Maker using a step-by-step process that introduces a
number of basic concepts that the software uses. Follow this tutorial carefully and make sure you grasp all
the steps. Once you finished this first game, the others will become easier.
6. Ending the Game: The game ends when the player presses the <Esc> key
7. Victory Conditions: It‟s all about the high score, baby!
A. We need to muster two images for Catch the Clown: a WALL (see Case 2.1, above) and a CLOWN
(2.2). You can make your own Sprites of course, using any drawing program you like. Game Maker
even has its own drawing tools. Alternately, there are libraries of such art to be found by searching
the internet (with many provided on the Game Maker web site). This tutorial comes with Sprites
already provided in the „Resources‟ folder, so for now, let‟s use those „default‟ Sprites.
B. To add Sprites to a game you‟re creating using Game Maker, go to the menu and select Add and then
choose Add Sprite. You‟ll see the following „form‟ window appear:
Sprites
The 2D images used in
Game Maker are called
“Sprites.”
Then press the Load Sprite button and select the file that contains the CLOWN image from the
„Resources‟ folder. This will show that Sprite in the form window.
Fill in the Name field and give the Sprite a name that will serve you well as you create this game.
1 Library
When the screen looks like it does above, press the OK button to add that Sprite to your game.
Important: Then do the same for the WALL Sprite, giving it the Name of
Long May
They Wave spr_WALL_INTIALS,
„Wave‟ files are great
for short sound effects C. You‟ll discover that as you add (“define”) Sprites, sounds, Objects, Rooms, and other files to your
and, while you can
game, they appear on the left window of the program. This is a handy list of all the resources (or
make your own with
some expertise, the “assets”) that you can quickly select from when you want to change (Edit), duplicate, or delete it
internet is full of cool by right-clicking on the resource name. This feature will prove its power as you make more
.wav files. complicated games.
Naturally, the Game
Maker web site has
some for you, and this
D. With the Sprites are added, we must now add the sound effects
tutorial comes with its using two .wav files from the „Resources‟ folder.
own in the in the
„Resources‟ folder. From the menu, select Add and then Add Sound. You‟ll see the
Heck, open up
Windows Explorer and
search for *.wav files
and look how many are Alan Emrich. tutorial
already on the
computer you‟re using
right now!
Game Maker tutorial 1 – Page 4
form on the right appear. Press the button labeled Load Sound and select the “bounce” file in the
Resources folder. This is the sound the CLOWN will make when bouncing off the WALL.
Rename the file snd_bounce_intials (for “sound: bounce”) and go ahead and click on the
Green Right Arrow button it listen to it. When you have this file all organized and renamed, you‟ll
be looking at the following screen. Press the OK button to lock this asset in.
Important: Then do the same for the click sound, giving it the Name of snd_click.
A. The assets we‟ve created are used to create game Objects (out of the Sprites and sounds).
To make the game, one or more instances of these game Objects appears in the game
world (see the sidebar to help you grasp the difference between an Object and an instance
The Difference
Between an ‘Object’
of it in the game).
and ‘Instances’ of
Those Objects
Note that there can be more than one instance of an Object present on the screen (within
An Object defines a
particular game Object the game world). For example, in Catch the CLOWN, there will be a large number of
with its behavior (that is,
reaction to Events). Of
instances of the WALL Object, but only one instance of the CLOWN Object.
this Object there can be
one or more instances
(copies of it) actually in Now, instances of game Objects don‟t do anything in your game until you tell them to.
the game. Each You do this by indicating how the instances of the Object must react to Events that happen
instance will act
according to the defined during the game. Note that there are many, many types of Events that can happen!
behavior for that Object.
Stated differently, an
Object is an abstract 1. In The Beginning: The first Event is usually the Create Event.
thing, while an instance
is a copy of it that we This tell a piece that was just “put on the board” what to start doing
use to play the game.
(i.e., move around and not just sit there).
For example we might
have multiple instances 2. Ouch: Another important Event happens with two instances collide.
(lots of monsters) of a
monster object in a This is called a Collision Event. In Catch the Clown, when the CLOWN collides with an
game. When we talk
about the monster instance of the WALL, it will react by „bouncing‟ off it and changing its direction.
object we mean all the
instances of the 3. Hey, I Felt That: When a player presses a key or clicks the mouse on an instance,
monster in the game.
When we talk about the
things can also happen.
instance we mean one For the CLOWN, we‟ll use a Mouse Event to make it react and add points to our score.
particular instance of
the monster.
And it‟s not enough to specify what the Events are, you must also indicate what Action
Here’s a better occurs with that Event. Game Maker provides a wide assortment of Actions (and there‟s a
example. In a Chess
game, we create a lot more than what you see, as you‟ll discover in Advanced Game Prototyping). We are
piece for it called
obj_king_black. We only
using the advanced mode
need one instance of Examples include Actions that set the instance of an Object in motion in a particular
that Object in the game.
But for direction, or change the score, or play sounds.
obj_bishop_black we
would need two
instances of that Object So, defining an Object consists of a few things:
in a Chess game, right?
And eight instances of
obj_pawn_white. Get it? 1. We need to assign that Object a Sprite image so players can see it; this also gives it a
physical presence and size in the game.
B. We need to create two Objects in Catch the Clown, a WALL and a CLOWN. Let‟s start with a
simple WALL Object. It‟s
simple because it needs no behavior at all; it does
not react to any Events.
Don’t panic! You‟re now at the operating table where you will work on the real „guts‟ of the game,
but it‟s not too scary once you use this screen a few times. Let‟s start by defining our WALL
Object…
1. Set the name to obj_WAL_INTIALSL. That‟s a familiar task. Remember use your initials
2. Choose the correct Sprite.
Remember, we previously defined all our Sprites; thus, they are now available to us – serving as
the graphic attribute as we define Objects in our game. Click on the little blue list selection
icon next to the words <no Sprite> and, from the pop-up menu that appears, select spr_WALL.
3. We want the WALL to be Solid; that is, we don‟t want Objects to pass through it. Simple check
the box labeled Solid. Then press the OK button and we are done with the WALL Object.
The CLOWN will be trickier because it has to do stuff in our game. However, we start to make the
CLOWN Object in the exact same way.
1. Add a new Object; change its name to obj_CLOWN; choose the correct Sprite. The CLOWN
Object does not need to be solid.
2. You know how to do all this from the WALL, but there is more to do for the CLOWN; we have to
specify its behavior, and for that we‟ll need to use more of this screen‟s functions.
Note, to select an Action, you don‟t left-click on the icon! You can either right-click on it
or click and drag it over to the Actions box; that Action will then happen when the Event
selected in the Events box occurs. Just pretend your reading this as you normally would
from left-to-right and you‟ll be fine. Watch…
3. First, we need to add a Create Event to put an instance of the CLOWN in play. When it
appears (the “Event”), we want it to start moving in a random direction (the “Action”
triggered by the Event).
Press the Add Event button below the Event box and the following
form appears:
more by letting the instance know how to move; thus, another pop-up menu appears,
as shown to the right. Most
game Actions require further definition, and
easy pop-up menus like this one allow you to do this.
For the moment, forget the box with the label Applies to; it applies to itself, but you‟ll
learn more about this later.
Below that, we can specify two key properties: the direction in which this instance will move,
and the speed it will travel. Because we want a random direction, click on all eight direction
arrows (but not the center square; that stops motion!). By doing this, you‟re telling that
instance to randomly select one of these eight directions.
Set the speed to „4‟ by tying in that number over the default value of „0.‟ So you know, „4‟ is a
nice speed; at higher values the CLOWN starts to go pretty fast.
Now, scroll the mouse over the “Start moving in a direction” Action in the Action box. The
rollover text should read, “start moving in directions 111101111 with speed set to 4”. With that
confirmation, you‟re good to go. The Object Property window should look like this:
With the WALL collision Event selected (by default), it needs a Bounce Action to occur. (Remember,
we‟re in the Object Properties window for the CLOWN Object – we‟re telling each instance of the
CLOWN Object that, when it collides with a WALL, that CLOWN instance will bounce.) To do this, select
the last Action icon on the right showing an arrow bouncing off a WALL as shown to the right.
Right-click or click-and-drag it over to the Action box and a pop up window will appear (as illustrated
to the right).
Although there are values that you can adjust in this window (“Applies to” et al), the default values are
fine for our purposes here. We don‟t need precise bounces and we do want to bounce against solid
Objects (remember, we made the WALL a Solid Object by checking that box ). Press the OK button to
close this window. Again, you can scroll over the bounce Action in the Action box and look at the
rollover text to confirm that you have the settings right.
But wait, we have a sound for this bouncing Event, too! To include it, go to the tabs on the far right-
hand side of this window and select main 1. The icon you want looks like a speaker; drag it over to the
Action box. When the definition pop-up window appears (as illustrated on the left), click on the top
blue list selection icon and select snd_bounce. Are you seeing why we gave those files names that we
would easily recognize later? The second property is whether we want this sound to “loop” (play
continuously once it is started); we don‟t, so set leave the default value of “false” alone – that‟s what
you want. Press OK to confirm all this.
Collision Event summary: As you can see, there are two Actions that are both performed (in the
exact order listed, by the way) when an instance of the CLOWN collides with an instance of the WALL:
1) the CLOWN bounces (not precisely), and 2) the bounce sound is played. Do these „rules‟ that you‟ve
just „written‟ for the clown unit make sense to you?
5. Finally, with the Object Properties window, we to define a Mouse Event to occur to
add points to your score when you click on the CLOWN.
What‟s a „Left
Pressed‟ Mouse
Event? Again click on the Add Event button below the Events
box; choose the Mouse Event. Again a pop up menu
This Action will happen
only when the player appears with many choices to help you define exactly
presses the left mouse what kind of Mouse Event you are interested in. (Go
button on an instance of ahead and look at all of these powerful options for a
the Object. second.) The one you want right now is Left pressed.
Other Mouse Events
options can happen all We need three Actions to occur when the left mouse
the time while the player button is pressed on an instance of a CLOWN Object:
keeps the mouse
pressed or happen
independently from First, the player‟s score needs to increase. Game Maker
where the player automatically keeps and displays a score. To increase
presses the mouse the score drag the Action, go to the tabbed page (on the right) named score and drag
button. the three coins icon in the gray box (Set the score) at the top over to the Actions box.
The form shown on the right will appear:
Now, we want the CLOWN jump to a new random position when it is clicked on to increase the
gameplay challenge. Hey, this is an arcade game; you‟ve got to do stuff like that. Select the tab page
move. Conveniently, there is an Action that does exactly function. Drag the Action with the arrow
pointing towards the question mark (called „Jump to a random position‟) over to the Action box,
and the form shown on the right will pop up.
Lucky you! The default settings are fine, so just press OK to close this form.
Finally, it‟s not enough to send the CLOWN in a new direction; we also want it its speed to increase
just a tiny bit (as indicated in the Design Document). To ramp up the CLOWN‟S speed, we again use
the Action with the eight red arrows to set the motion. Once again, select all eight arrows by clicking
on them, but this time type a value of 0.5 (one-half) for the speed and click on the Relative box.
What this does is increase the CLOWN‟S speed by 0.5 every time it is clicked. Thus, the CLOWN
keeps getting faster and faster. The form should now look as follows:
That‟s it for the CLOWN Object. It gets created, it bounces off the walls, plus we score points
and it picks up speed when clicked on. Thus, we have defined Actions for the three Events that
constitute this game‟s core mechanic. Now it‟s time to press the OK button to close the form.
1. In the frame on the left side of the screen, you see the tabs for three different pages: Objects, settings,
and backgrounds. We‟ll only be using Objects at this time.
2. The majority of space (on the right) is the current Room (or „level‟). It appears as a grey area with a
square grid on it to help regulate the (set up) placement of Objects within it.
Because the Objects in this game are 32 pixels by 32 pixels, you‟ll need to change the size
of the grid squares.
At the top of this window are the Snap X and Snap Y values set to their default value of 16;
change these values to „32‟.
Note the change in the size of the grid squares; they‟ll not fit our Objects.
3. You‟re about to add the Objects you‟ve created to this Room. To do this, look at the bottom of the
frame on the left that is entitled, “Object to add with left mouse.” Currently, it‟s set to spr_clown.
Let‟s put the walls down first.
Click on the select item button to the right of spr_clown and select spr_wall from the pop-up
menu. You‟re now locked, loaded, and ready to place WALL Objects around the Room.
To add instances of a particular Object (in this case, the WALL Object), use the mouse to place
instances of the WALL in the cells along the edge (i.e., the border) of the Room. You might have to
enlarge the window or use the scroll bars to see the whole Room.
a) If you hold the <Shift> key while moving the mouse, multiple
instances will be added and you can ‘paint’ that Object around the
Room.
b) If you made a mistake you can use the right mouse button to delete
instances.
4. Finally, select the obj_clown initials Object and place one instance of it in the middle of the Room.
Your Room should now look like this:
That‟s it! Our one-and-only Room (level) is designed and ready. Close this window using the OK
button, which is the one with the big green checkmark at the left top of the form.
Guess what? You‟re game is ready to be tested now! All of the requirements are in place: you‟ve
snagged Sprites and sounds and molded them into Objects for which they have defined Events and
Actions; a level has been build and populated with Objects, so now all of the minimum requirements
for a game exist. So let‟s save the game and test it!!
A. Saving the game is simple – it works like any Windows program. Go to the command line at the top
and choose File and then Save; select a location (your memory stick will do) and a file name (like
clown_1).
***Game Maker will automatically ennoble your file with the extension .gm6 (because you‟re creating
Game Maker version 6 file).
Note that you can not yet play this game; you‟ve only saved your file and that can only be viewed in
Game Maker. However, we can turn this file into a stand-alone executable that can be played in about
a second-and-a-half, but first let‟s test what we have to make it truly worthy of turning into a stand-
alone game file.
B. Testing the game is crucial. You‟re about to do some Gross Playtesting on your
design and, if you‟re satisfied with it, should then let others try it out and get
their feedback.
Testing (or even running the game in general) is easy. From the command menu, choose Run and then
Run normally. The design window disappears and the game will start (if you did not make any
mistakes). Try clicking on the CLOWN to if it‟s working right. After about 15 or so clicks, the CLOWN
is moving so fast that it‟s pretty hard to hit.
Note that you should be hearing the right sounds when the CLOWN bounces or your mouse clicks on it.
Also, the CLOWN should be teleporting around and changing to a random direction when you hit it.
To end the game, close the window or press the <Esc> key; that will take you
back to the Game Maker design window where you can make changes and
adjustments to your game.
It is at this point, when your game is still just a prototype and very malleable („easily changeable‟) that
you should be asking a lot of questions about the gameplay experience.
The beauty of Game Maker is that if you‟re not happy, it‟s very easy to make changes and test them out
in a matter of moments. Then you should seek out the feedback of other playtesters.
To create a stand-alone executable, from the command line at the top of the window, select File and
then Create executable, indicating where you want to save it and giving it a name. That‟s it. You can
close Game Maker if you like and simply run the executable file you created.
From the command menu, select Add and then Add Background. You‟ll see a form that
is very similar to the Sprite form. Click the Load Background button within that
window and select the one so indicated in the Resources folder. The background form
will look like this:
“Tiling” the
Background Note that for background the property. Press the
Take a look at the two OK button to wrap up this screen.
check boxes below the
image file named: Tile
With that Background Resource defined, you have
Hor. and Tile Vert.
to place it in your game. To do that, open up your
They indicate that the
background must be Room Resource by double-clicking on its listing in
“tiled” horizontally and the left-hand pane of the main Game Maker
vertically; that is, window.
repeated to fill the
whole Room.For this to
work correctly the 1. Select the tab in the upper-left of this form
background image marked background. You‟re now looking, in
must be made such part, at this form on the right.
that it nicely fits against
itself without showing 2. First, uncheck the box labeled “Draw
cracks. background color.” You‟re throwing out the
Fortunately, many such default background color and will be plugging
images are available on
the internet. in your Background Resource.
3. Next, find the box that says “<no image>” and
click on the list button next to it. A pop-up
menu will appear with your Background
Resources listed; select your background file.
Suddenly, the Room background looks much
better.
D. After you play the game a while, you will notice that it is very easy because you know
exactly where the CLOWN is going. That doesn‟t have to be the case.
To make the game more challenging, let the CLOWN randomly change its direction of
motion from time to time. To this end you are about to learn the Alarm Clock Event.
Cool!
These „alarm clocks‟ tick down the time and, when they count down to 0, the Alarm
How Much Time Event it triggered. Each instance of an Object can have a maximum of eight different alarm
is in a “Step?” clocks set for it. Fortunately, we need just one for Catch the Clown.
2. Okay, an alarm clock Action is set to take place 1.5 seconds after the CLOWN is
created, but what happens when it does? We need to define that by creating an Event for this alarm
clock and defining what its Actions are!
Click on the Add Event button below the Events box; select Alarm and, from
the pop-up menu that follows, Alarm 0. Now you‟ll see it as a listed Event in
that box, waiting to have its Actions defined. Okay, let‟s define what happens
when Alarm 0 goes off…
3. Click on the move tab. We‟ll set a new random direction of motion for the CLOWN by dragging the
Action icon with the red arrows (in the upper-left of the move page, Start moving in a direction) over
to the Action box. In its pop-up menu, click on all eight arrows and set the speed to „0‟ – be sure to
check Relative box! That means that the CLOWN‟S speed will not be changed by this Action.
4. But the way we have things now, this Action will only take place one time, 1.5 seconds after the
CLOWN appears at the start of the game. That‟s not enough; we want this Action to occur every 1.5
second. To do this, we have to add a housekeeping step – resetting the alarm back to „0.‟
To do this, another Action has to be added to the Alarm 0 Event. Once again, the tab page on the right
hand side and select main2 and drag the Select Alarm Clock icon (in the upper-left) over to the Action
box. Again, in the pop-up window, set „Alarm Clock 0‟ to 50 steps. That will create a „loop‟ where
this Action repeats the Alarm 0 Event every 1.5 seconds.
D. Finally, you should tell the players how to play the game and what the Object is; in other words, it is
time to write „the instructions.‟ Remember, Pong because the hit game that it was by having only one
instruction: “Avoid missing ball for high score.”
Game Maker has a standard feature for adding instructions to a game. To access this feature,
go to the command bar and select Add and then Change Game Information. A text editing
window appears and, in it, you can type in the information that player‟s will need (and edit
fonts, their sizes and colors, cut-and-paste – all that word processing goodness).
During the game this text is automatically shown when the player presses the F1 key (as with most
other programs). Alan Emrich is the resources for the sounds and graphics for this tutorial and the next
Way to go. You‟ve learned a lot about Game Maker along the way.
You‟ll find that Sprites and sounds are important resources in any game editor. Also, in many of these, it
is useful to think in terms of game Objects that take Actions in response to Events.
Before starting the next tutorial, however, spend a little more time making some
corrections to Catch the Clown. Here are a few suggestions:
1. Have two CLOWNs in the game. This is extremely easy because you can place
multiple instances of the same Object in a Room.
2. Create new CLOWNS with different colors that are worth different points; the
ones that are harder to catch should be worth more than the easy ones!
3. Make a dark CLOWN that you should not catch because it will cost you points.
Set as negative points not positive – copy the original clown and change the
points
4. What if there was a wall section right in the middle of the arena?