Professional Documents
Culture Documents
Gamemaker Maze Design
Gamemaker Maze Design
IN GAME MAKER 7
In this tutorial, you will learn how to create your first game in
Game Maker. The game you will create will be a simple
maze game. The object of the game will be for the player to
move through the maze to reach the end point.
2. In the Room Properties panel that appears, select the settings tab and
name the room. Use the names specified above as a guide to what you
will call your rooms.
3. In the Caption for the room cell, type in a caption for your game.
This will appear at the top of the game
4. Select the green tick in the top left hand corner to save your room.
Repeat this process until you have set up three rooms. These will appear in
the rooms folder in the Resource Explore window at the left of the screen.
Your rooms folder should look like the one shown here on the right.
When you want to create a character or object for your game, you need to first create it as a sprite and
then make it an object. Think of a sprite as the visible part of an object. You will understand this
better as you work through the next steps.
We will need to set up three sprites for the game. In my game, these will be the following. You may
however wish to have a different context for your game. Just say your player will be represented by a
ghost rather than a princess, simply change the name from spr_princess to spr_ghost and so on.
A Games in Learning Project Tutorial - www.gamesinlearning.com - Tutorial by Kristine Kopelke - Email kkope1@eq.edu.au
Page 1 of 9
2. In the Sprite Properties panel that appears,
enter the name of your sprite.
Before you start to draw your sprite in the Image Editor, here are a few tips:
Tip #1 The size of your canvas where you will draw your sprite is set by default to 32px x 32px.
This is a good size for tiles and objects within the game screen which is currently set at
640px x 480px. However, you may want to create sprites for characters and objects with
different sizes. To change the canvas size so you have space to draw bigger objects and
characters, select Transform from the menu and then choose Resize Canvas.
Tip #2 The checkbox labeled Transparent (shown above) indicates whether the rectangular
background of the sprite image should be considered as being transparent. Most sprites are
transparent. The background is determined by the colour of the leftmost bottommost pixel
of the image. So make sure that no pixel of the actual image has this colour.
Tip #3 It’s a good idea to use the Zoom In and Zoom Out tools when drawing and
editing your sprite. By doing so, it will be easier to see what you are doing and
you’ll be able to create sprites with more detail.
7. Once you are happy with your sprite, select the green tick button
in the top left hand corner. This will take you into the Sprite
Editor panel, select the green tick again to return to the Sprite
Properties panel. Once there, select the OK button at the bottom.
Repeat the process outlined in steps 1—7 until you have set up all
three sprites for your game. Note that the sprite you will use for the
wall of your maze will need to be the same size 32px x 32px. You will
place multiple copies of this sprite / object when you make
the walls of your maze in a later step. When you have finished
designing the sprites you need for your game, the Sprites Folder in
the Resource Manager window should look like the one shown here.
A Games in Learning Project Tutorial - www.gamesinlearning.com - Tutorial by Kristine Kopelke - Email kkope1@eq.edu.au
Page 2 of 9
Creating the Objects for your game ABOUT OBJECTS
You have just created the sprites for the game. A sprite is an Objects are placed in rooms within your
image that can be used to represent an object. In this next game. They are the main features of
sequence of steps, you will set up the objects for the game. your game and can include game char-
acters, inventory items, walls and mov-
Before you start working through the steps below, learn about ing objects. When you create and edit
objects and how they work in Game Maker by reading the box an object, you can select if it should be
to the right. visible or invisible, moving or static or
solid or not solid. Objects can be set up
To create the object for your main character in the game, follow to move and react to input from the
these steps. player and other objects. Things that
happen to objects are called events.
1. Select the Create an Object button on the toolbar. Every time you place an object in your
game, you place an instance of that ob-
2. In the Object Properties panel that appears enter the ject. For example, if you create an ob-
ject called tree and then place multiple
name for your object. The name I have entered is
copies in your room to create a forest,
obj_princess, however yours could be something like
each copy of the tree is an instance.
obj_ghost, depending on what your main character is.
Note that the use of the prefixes obj, spr and rm are just
designed to help us identify what type of item we are dealing
with. When creating programs or games, it is common
practice to use conventions like this.
To create the object that you will repeat for the wall of the
maze, follow these steps.
2. In the Object Properties panel that appears enter the name for your object. The name I have
entered is obj_hedge.
3. Select the sprite that will represent your object by clicking on the Sprite Selector button and choosing
the sprite from the drop down menu that appears (shown here).
4. Click on the box next to the word Solid to make your object solid.
To create the object that you will use for the end point in your maze, follow the same steps. In my game,
this object is obj_castle.
Once you have set up all three of your objects, the Objects
folder in the Resource Manager window should look like this.
A Games in Learning Project Tutorial - www.gamesinlearning.com - Tutorial by Kristine Kopelke - Email kkope1@eq.edu.au
Page 3 of 9
Putting your objects in the rooms
We are now going to place the objects you have created in the room containing the maze. Follow these
steps to do this.
1. Double-Click on the rm_maze room in the Rooms folder in the Resource Manager.
2. In the Room Properties panel that appears, select the Background tab and
then click on the box containing the colour to select the colour you
would like for your background. Note that you can use images for your
background, however in this tutorial we are only using a solid background
colour.
6. Now select the object you want to add and click on the room to add
the object. If you put the object in the wrong spot, simply right
click on it to remove it from the room. To add multiple copies of
an object to the room quickly, simply hold down shift whilst clicking
and dragging. This is the most efficient way of adding the walls of
the maze. Once you have added the objects to your maze room,
you should have something like the image to the right.
1. Now when you add text to your game in Game Maker, by default the font is set to
Arial and the size is 12pts. You will most likely want to use a larger and more
interesting font for the text in your Title and Game Over rooms. To do this, we
need to add a font.
To do this, select the Create a Font button from the toolbar at the top.
2. In the font panel that appears, select the font you would like to use for your
text, give this font a name such as fnt_main and increase the size of the font.
Select the OK button at the bottom. On a piece of paper, make a note of the
font and size you selected as you will need this info in a later step.
Note that this font will now appear in the Resource Manager panel in the fonts
folder. This means it will be loaded into your game and can be used when
creating the sprites for your text in your next step.
A Games in Learning Project Tutorial - www.gamesinlearning.com - Tutorial by Kristine Kopelke - Email kkope1@eq.edu.au
Page 4 of 9
3. Create a new sprite by selecting the Sprite button (shown here).
5. Select Edit Sprite to enter the Sprite Editor. Double click on the green box to enter the Image
Editing Panel.
6. You won’t fit much text in the default image size of 32px x 32px, so
select Transform > Resize Canvas. In the Resize Panel that appears
(shown to the right), change the width to 300 px and the height
to 100 px. You will need to uncheck the Keep aspect ratio box to
do this. Select OK.
7. Select the Text menu from the top menu bar and select Font.
Choose the font and font size you set up in the previous step. Note
that you can select any font on your system, but that they only work
in your final game if you have set them up as a font using the Create
a Font tool.
8. Select the Draw Text button from the toolbar at the left of the
Image Editing Panel.
9. Enter your text in the Drawing a Text box that appears. Select OK.
10. Move your mouse over the text you have added and drag the text into
the position you want it to be in.
11. When you are happy with the text, select the green tick in the Image Editing panel. Then select
the green tick again in the Sprite Editor panel. Your text is now in a sprite that can be added to
an object to display in the Title Room.
12. Select the Create an Object button to create the object for the title text.
Name this object obj_titletext and select the sprite you just made
containing the text. Select OK from the bottom.
13. Double click on the room name rm_title to open the Title Room.
14. Select the Background tab and then select a background colour for this
room.
15. Select the Objects panel and select the title text
object obj_titletext. Add this to the stage.
At this stage, you have added some text to only the Title
Room in your game. You should now take some time to add
some text to the Game Over room. You may also want to add
additional text to the Title room.
A Games in Learning Project Tutorial - www.gamesinlearning.com - Tutorial by Kristine Kopelke - Email kkope1@eq.edu.au
Page 5 of 9
Adding a Start Button to your game
We have nearly set up all of the elements of our game. However, at this stage, if we played the game,
you would only be able to see the Title room. You would be stuck on this page as we haven’t added a
button for the user to click to move onto the main game area, the room named rm_maze.
You will then need to Create an Object and set up the object
for the start button. I named this object obj_start. Once
you have done this, add the object to your Title Room.
3. From this menu, select Mouse > Left Button. This will
mean that the action we set in the next step will occur when
the player places their mouse over the Start button object
and presses the left mouse button.
4. We are now going to add an action that will take the player
to the next room when they click on the button. To do this,
select the main 1 tab from the collection of tabs on the
right hand side of the Object Properties panel (as circled).
Test your game by clicking the Run button. You should now be
able to click on the start button and move to the maze room. If
not, check the order of your rooms in the Resource Manager and reorder if needed.
A Games in Learning Project Tutorial - www.gamesinlearning.com - Tutorial by Kristine Kopelke - Email kkope1@eq.edu.au
Page 6 of 9
Adding Events and Actions to the Main Character
It’s now time to add the main interactivity to the game. To do this we are going to add five events and
associated actions to the character object.
1. Double click on your main character object from the Resource Manager window e.g. obj_princess.
3. Make sure the move tab is selected and click and drag
the Move Fixed action into the Actions Panel.
If you test your game now, you’ll see that you can make your character move by pressing the different ar-
row keys. The problem is that your character walks over the top of the walls of your maze.
We need to add a Collision Event and a Move Fixed Action to prevent this
from happening. To do this, follow these steps:
Test your game, you will now be able to move your player around the maze.
A Games in Learning Project Tutorial - www.gamesinlearning.com - Tutorial by Kristine Kopelke - Email kkope1@eq.edu.au
Page 7 of 9
Adding the Final Interaction
The last action we need to add to our main character is the action that will take the player to the Game
Over scene. To set this up, we will add one additional event and action to our main character object.
1. Double click on your main character object in the Resource Manager window (e.g. obj_princess).
2. Select Add Event and choose the Collision event. From the
drop down menu, select the object you have created to be your
end point. In my game, this is obj_castle.
Test your game now and see what you think. You should be
able to click on the Start button in the Title Room (rm_title) and
then move your character around the maze in the Maze Room
(rm_maze). When your character reaches the castle or the
end point of the maze, you should be taken to the Game Over
Room (rm_gameover).
Have you worked out what’s missing? It’s a button to allow the player to start again. After all, it’s such a
great game, they’ll most likely want to. Ok, well I guess it’s not going to win any Game Development
Awards, but it is your first game, so you should make it fully functional.
So it’s time to add the Start Again or Replay button. You will need to design the sprite for this button,
create the object for the button and then add the correct event and action. I’m not going to show you
how to do this, because you should know what to do by now. However, I will give you a hint, there is
another action in the main1 tab that allows you to specify which room the player is taken to. It is called
the Different Room action. When you drag this into the panel, you’ll be able to choose the room you
want the player to be taken to.
Your game is now playable, but it could be enhanced with the use of some sound. In the steps below, you
will learn how to add sound to your game.
2. In the panel that opens give your sound a name e.g. snd_bgmusic and
then select Load Sound. Select a sound file from your computer.
Game Maker can use wav, midi and MP3 sound files. Note that you can
get a large number of free sound files off the web. A good place to get
sound files from is the loops section of the Flashkit site at
www.flashkit.com.
3. In the Kind options, select Background Music. Note that you can also
select Normal Sound for sounds you want to play on events e.g. when
the Princess runs into the Hedge.
A Games in Learning Project Tutorial - www.gamesinlearning.com - Tutorial by Kristine Kopelke - Email kkope1@eq.edu.au
Page 8 of 9
Even though you have created a sound for use in your game, it can’t be heard in the game until you attach
it to one of your objects. Complete the following steps to get it working.
1. Double click on your main character object (e.g. obj_princess) to open the Object Properties
panel.
2. Select the Add Event option and select Create. The Create event launches the attached action
at the time in which the object it is attached to appears in the game. In this case, we will be attaching
the sound. This will play when the Maze Room is reached as this is the first point in the game where
the Princess or main character appears.
3. Select the main1 tab and from the action collection, select the Play Sound button
and drag it into the Actions area.
Now you should have been saving your game whilst working through this tutorial. I didn’t remind you
because it’s something you should regularly do regardless of the application you are working in.
It’s now time to save your final game. To do this select File > Save. Give your file a name if you
haven’t done so already. This is the file that you can reopen in Game Maker when you want to edit or
enhance your game.
Your final step is to make your game a standalone application - a game that can be played on any PC,
regardless of whether Game Maker is installed. To do this, select File > Create Executable. This will
allow you to save your file in .exe format. To play your game from this file, simply open the .exe file in
the location you have saved it. You will see that your game opens in it’s own window. It is now ready to
share with friends.
If you’ve got to this point—you’ve created your first game in Game Maker. This tutorial was designed to
introduce you to making games in this application and to help you develop an understanding of the Game
Maker basics. You should be able to take what you’ve learnt and apply it in a different game context.
Remember that one of the best ways to learn is to click around, roll over and explore the different events,
actions and features in the program.
If you’re ready to take on some other tutorials, head to some of the following websites:
A Games in Learning Project Tutorial - www.gamesinlearning.com - Tutorial by Kristine Kopelke - Email kkope1@eq.edu.au
Page 9 of 9