Professional Documents
Culture Documents
TABLE OF CONTENTS
WHAT IS GAME MAKER? ................................................................................................................................................................... 2
GAME MAKER SCREEN ................................................................................................................................................................................ 2
LESSON 1 THE CLOWN GAME .......................................................................................................................................................... 4
SPRITES - CLOWN ....................................................................................................................................................................................... 4
BACKGROUND CLOWN .............................................................................................................................................................................. 6
SOUND BOUNCE ...................................................................................................................................................................................... 6
OBJECTS WALL & CLOWN ......................................................................................................................................................................... 6
CREATE EVENT THE CLOWN ....................................................................................................................................................................... 7
ALARM EVENT THE CLOWN ....................................................................................................................................................................... 9
COLLISION EVENT THE CLOWN HITS A WALL ................................................................................................................................................ 9
MOUSE EVENT HIT THE CLOWN ............................................................................................................................................................... 10
ROOMS ENTER THE CLOWN..................................................................................................................................................................... 11
LESSON 2 THE MAZE GAME ........................................................................................................................................................... 12
SPRITES BASIC WALL, PERSON & GOAL...................................................................................................................................................... 12
OBJECTS BASIC WALL, PERSON & GOAL .................................................................................................................................................... 12
EVENTS/ACTIONS PLAYER MOVEMENT ...................................................................................................................................................... 12
ROOMS MAZE 1 .................................................................................................................................................................................... 14
LESSON 4 MAZE GAME PART 2 ...................................................................................................................................................... 15
SPRITES DIAMONDS & 3-D WALLS ........................................................................................................................................................... 15
SOUNDS MUSIC & SOUND FX .................................................................................................................................................................. 16
BACKGROUND ROOM & SPLASH BACKGROUND ........................................................................................................................................... 16
FONTS SCORE FONT ............................................................................................................................................................................... 17
OBJECTS DIAMONDS & 3-D WALLS .......................................................................................................................................................... 17
CONTROLLERS .......................................................................................................................................................................................... 20
ROOMS SPLASH PAGE ............................................................................................................................................................................ 21
LESSON 5 MAZE GAME PART 3 ...................................................................................................................................................... 24
SPRITES MONSTERS, BOMBS & BLOCKS ..................................................................................................................................................... 24
SOUNDS OTHER SOUND FX ..................................................................................................................................................................... 25
OBJECTS MONSTERS, BOMBS & BLOCKS .................................................................................................................................................... 26
MONSTER COLLISIONS............................................................................................................................................................................... 27
THE BLOCK.............................................................................................................................................................................................. 28
MONSTER MOVEMENT ............................................................................................................................................................................. 29
THE HOLE ............................................................................................................................................................................................... 31
THE BOMB, TRIGGER & EXPLOSION ............................................................................................................................................................. 31
PLAYER SPRITE UPDATE ............................................................................................................................................................................. 33
SOUNDS - LIFE ......................................................................................................................................................................................... 33
OBJECTS PLAYER & LIFE .......................................................................................................................................................................... 33
ROOMS ADDITIONAL .............................................................................................................................................................................. 34
LESSON 6 COMPLETING THE MAZE GAME ..................................................................................................................................... 36
SPRITES ONE RING TO RULE THEM ALL ...................................................................................................................................................... 36
GAME INFORMATION ................................................................................................................................................................................ 37
1|P a g e
2|P a g e
The main components used to create games in Game Maker include the following:
Component
Description
Prefix
Example
Sprites
This can be an image or a series of images such as animated gifs. Sprites contain
additional properties such as transparency, width, height, bounding box, collision
detection.
spr
sprPlayer
Objects
These are the living' actors that are given behaviours which respond to events. For
example, the arrow keys (events) will initiate their movement across the screen
(actions).
obj
objPlayer
Sounds
This can include sound fx (e.g. bouncing ball, laser shot) or background music for
the game. Game Maker allows the mp3, midi or wav format.
snd
sndMusic
Backgrounds
These are used to add background images to the game. This background can either
be static (still) or animated.
bgr
bkdRoom
Room
The other components of the Game Maker screen (paths, scripts, time lines) are used in the Advanced Mode.
They will not be needed at this stage of the tutorial.
3|P a g e
Resource Files
The files needed for this tutorial are located in the Lecture Resources/Resources 2 directory in the Game Maker
folder that was copied earlier.
SPRITES - CLOWN
1. Create a new Game Maker file (File>New) then save as CLOWN. Remember to save the file every few
minutes.
2. You will need to add a number of sprites for this game. To do this right-click on the Sprites folder and select
Create Sprite.
4|P a g e
4. Repeat the last two steps and load the wall image using an appropriate sprite name, e.g sprWall.
5|P a g e
SOUND BOUNCE
7. Right-click the Sounds folder and select Insert Sound.
8. Click on the Load Sound button and select the bounce.wav file then click Open. Type sndBounce in the
Name box then click OK.
9. Repeat the last two steps for the click.wav and music.mid files using appropriate sound names, e.g. sndClick,
sndMusic.
6|P a g e
12. Repeat the last two steps for the sprClown sprite but do not make it solid.
Events/Actions
Attaching events and actions to objects gives life or interactivity to the game. An object might react to an
event (such as a collision with the wall) and its re-action might be that it bounces back off the wall.
There are many events and actions that can shape your game. Rather than explain the function of each event and
action available in Game Maker, you will learn some of these as you construct the Clown game. Use the Help
menu in Game Maker if you wish to learn a little more about them.
7|P a g e
16. To make the game less predictable we will add an alarm clock. In the Main2 action list select the Set Alarm
action. Set the number of steps to 50 and the in alarm no to Alarm 0.
8|P a g e
18. From the Move action list add the Move Fixed
19. From the Main2 action list add the Set Alarm
action. Click all 8 directional buttons and set the speed action. Set the number of steps to 50 and the in alarm
to 0 and check the relative box then click OK.
no to Alarm 0.
Check that the events and actions match the list below:
Create
10 | P a g e
Alarm 0
Left pressed
28. It is now time to add the objects that will form the basis of the clown game. Click on the Objects tab then
click the object selection button and select the objWall object.
29. Use the left mouse button to place the wall around the boundary of the room. If you make a mistake use the
right-mouse button to remove the object from the Stage.
30. Click the object selection button and select the objClown object and place one instance in the middle of the
room.
11 | P a g e
Resource Files
The files needed for this tutorial are located in the Lecture Resources/Resources 3 directory in the Game
Maker folder that was copied earlier.
Name
Remove Background
wall.gif
sprWall
No
person.gif
sprPerson
Yes
goal.gif
sprGoal
Yes
12 | P a g e
Action List
Control
Keyboard <right>
Move
Control
Keyboard <down>
Move
Control
Keyboard <up>
Action
Check Grid
Move Fixed
Check Grid
Move Fixed
Check Grid
Move
Settings
snap hor: 32; snap vert: 32
Direction - Right button; Speed - 4
snap hor: 32; snap vert: 32
Direction - Down button; Speed: 4
snap hor: 32; snap vert: 32
Direction: Up button; Speed: 4
Move Fixed
Control
Keyboard <no key >
Check Grid
Move
13 | P a g e
Action List
Main1
Main1
Action
If next room exists
Go to next room
Settings
-
Transition (optional)
Collision objPerson
Control
Main 2
Else
Restart game
11. The events/actions for the objGoal object will allow the player to move to the next room (if it exists) once it
collides with objPerson object.
ROOMS MAZE 1
12. Add a new room (right-click on Rooms folder, Add Room)
13. Click the settings tab and change the room size to 480 x 480, caption to Simple Maze and the snap x and
snap y values to 32.
14. Click the objects tab then select the appropriate object to create the following room using the objWall,
objGoal and objPerson objects.
14 | P a g e
Resource Files
The files needed for this tutorial are located in the Lecture Resources/Resources 3 directory in the Game
Maker folder that was copied earlier.
Name
Remove Background
wall_corner.gif
wall_corner
No
wall_horizontal.gif
wall_horizontal
No
wall_vertical.gif
wall_vertical
No
diamond.gif
sprDiamond
Yes
2. You will also need to create a sprite manually. Right-click the Sprites folder and select Add Sprite.
3. Click the Edit Sprite button then click the File>New to create a new sprite. Set the width and height to 32
then click OK. Double-click the transparent sprite that should now be visible on your screen. This will take you
into the Image Editor window.
15 | P a g e
select a red colour from the palette then click on the image.
twice then name the sprite sprDoor and uncheck the Remove
Name
background_music
sndMusic
diamond
sndDiamond
door
sndDoor
goal
sndGoal
17 | P a g e
15. The objDiamond object is going to be used to accumulate points in the maze. Using the table below create
the following events/actions for the objDiamond object:
Event
Action List
Score
collision, objPerson
Main1
Main1
Action
Play sound
Destroy instance
Settings
new score: 10; relative
Events/Actions Summary
The sequence of events and actions will result in a score of 10 being added each time a diamond is collected.
The sndDiamond sound will then be played followed by the removal of the diamond from the screen.
18 | P a g e
Action List
Action
Settings
Score
Main1
Main2
milliseconds: 1000
Main1
Control
Main1
collision, objPerson
Control
Control
Main2
Congratulations!
Score
Score
Main2
Control
The final list of actions should look like the diagram below...
19 | P a g e
Action List
Control
Control
collision, objPerson
Main1
Main1
Control
Action
Settings
object: objDiamond; number: 0; operation: Equal to
Start of block
Play sound
Destroy instance
End of block
Events/Actions Summary
The sequence of events and actions will result in the objDoor object being used to block the objGoal object in
the maze. The door will open (i.e. it will disappear) and the sndDoor sound played after all the diamonds have
been collected by the player, i.e. when the number of diamonds is equal to 0.
CONTROLLERS
Controllers are objects that perform actions based on events but are not actually seen by the player and therefore
do not require any sprites to be created. The maze game requires two controllers: the first controller will be used
at the start of the game (to reset the score amongst other things) while the second one will be used in every room
(e.g. to keep track of the score, etc.).
18. Right-click the Objects folder and select Insert Object. Type controller_start in the Name box and uncheck
the Visible box.
20 | P a g e
Action List
Action
new score: 0
Score
Main1
Create
Settings
Score
new lives: 3
sound: sndMusic; loop: true
Main1
Events/Actions Summary
The sequence of events and actions will result in the score being reset to 0, background music being played and
the scores being hidden. When a key is pressed the game will move to the next room.
20. Right-click the Objects folder and select Insert Object. Type controller_main in the Name box and uncheck
the Visible box.Using the table below add the following events/actions for the controller_main object:
Event
Draw
Action List
Action
Settings
Draw
font: score_font
Draw
color: red
Score
x: 0, y: 0, caption: Score; Relative
text: Lives; x: 90; y: 0; relative
x: 150; y: 0; sprite: sprHeart
Events/Actions Summary
The sequence of events and actions will result in the controller being used to set the font colour and position of
the score.
21 | P a g e
25. Open room1 and modify the room size to a height of 512. Place the controller_main object in the bottom
left corner.
26. Add a new room (right-click on Rooms folder, Add Room) to create room2.
27. Click the settings tab and change the room size to 480 x 512, caption to Collect all the diamonds! , the snap
x and snap y values to 32 and type room2 in the Name box. Place the controller_main object in the bottom left
corner as well as the other objects so that it looks like the example below.
22 | P a g e
23 | P a g e
Resource Files
The files needed for this tutorial are located in the Lecture Resources/Resources 3 directory in the Game Maker
folder that was copied earlier.
Name
Remove Background
monster1_nice.gif
sprMonsterlr
Yes
monster2_nice.gif
sprMonsterud
Yes
monster3_nice.gif
sprMonsterall
Yes
person.gif
sprLives
Yes
bomb.gif
sprBomb
Yes
trigger.gif
sprTrigger
Yes
explosion.gif
sprExplosion
Yes
block.gif
sprBlock
Yes
Open the sprMonsterlr to view the image. Click on the next subimage button
. You should notice that the
sprite is made up of a number of different images (similar to an animated gif). We will take advantage of this a
little later in the tutorial as we will be able to display the relevant view of the monster sub-image depending on
which direction it is going. Look at the other sprites to see their sub-images...
2. You will also need to create a new sprite manually. Right-click the Sprites folder and select Add Sprite.
3. Click the Edit Sprite button then select the File menu and New. Enter 32 for both the Width and Height
values then click OK.
24 | P a g e
Name
dead.wav
sndDead
explode.wav
sndExplode
hole.wav
sndHole
push.wav
sndPush
You should now have the following sounds. Note: the names might be slightly different
25 | P a g e
Object
sprMonsterlr
objMonsterlr
sprMonsterud
objMonsterud
sprMonsterall
objMonsterall
sprLives
objLives
sprBomb
objBomb
sprTrigger
objTrigger
sprExplosion
objExplode
sprBlock
objBlock
sprHole
objHole
26 | P a g e
collision, objMonsterlr
Settings
Main1
Main2
Score
Main1
The actions applied to the collision with objMonsterlr will be exactly the same for when the player collides with
the other monsters. Rather than repeating the above steps, you will duplicate the actions and events instead
9. Right click the collision with objMonsterlr event and select Duplicate Event. Select Collision then click
objMonsterud.
10. Right click the collision with objMonsterlr event and select Duplicate Event. Select Collision then click
objMonsterall.
27 | P a g e
THE BLOCK
9. (i) Using the table below add the following events/actions for the objBlock object:
Event
Action List
Control
Action
Settings
x: 8*other.hspeed,
y: 8*other.vspeed, relative
objects: All
Control
Main1
Move
x: 8*other.hspeed
y: 8*other.vspeed, relative
Control
collision, objPerson
Control
Control
Control
object: objHole,
x: 8*other.hspeed,
y: 8*other.vspeed, relative
Move
x: 8*other.hspeed, y: 8*other.vspeed,
relative
Control
Control
comment: do nothing
Events/Actions Summary
(i) The sequence of events and actions that are applied to the objBlock object will result in the player being able
to move the objBlock around the room. If the objHole object is standing in the way, the objBlock object can be
used to remove the obstruction. (ii) The purpose of the objPerson collision with objBlock event (although
appearing to do nothing) is to allow the player to make contact with the block so that they can move the block.
28 | P a g e
create
collision, objWall
Action List
Action
Settings
Control
Move
Control
Main1
Control
Main1
Control
Move
Events/Actions Summary
Create event - This will start the monster moving in either a left or right direction. Step event - This will check
to see if the monster is moving left or right. When hspeed is less than zero (i.e. moving from right to left) the
image needs to face left. The Change Sprite action will make sure that the monster is facing the correct
way. Collision event - This will move the monster in the opposite direction when it hits a wall.
11. Using the table below add the following additional events/actions to the monster_ud object:
Event
create
Action List
Settings
snap hor: 32; snap vert: 32
Move
Control
Main1
Control
Main1
29 | P a g e
Action
Control
Move
12. Using the table below add the following additional events/actions to the monster_all object:
Event
Action List
Action
Settings
Control
Move
Control
Control
sides: 8
Move
Control
Control
Control
Control
Control
Control
Control
Control
Move
Control
Control
Move
Control
Control
Move
create
step, step
collision, objWall
30 | P a g e
THE HOLE
13. Using the table below add the following events/actions for the objHole object:
Event
collision, objBlock
Action List
Action
Settings
Main1
Main1
Main1
Events/Actions Summary
The sequence of events/actions ensures that when the objBlock object makes contact (collides) with the objHole
object, both objects are removed. The sndHole effect is also played.
collision, objPerson
31 | P a g e
Action List
Action
Settings
Main1
sound: sndExplode
Main1
Main1
create
Action List
Action
Settings
Move
Main1
Main1
Main1
Main1
Main1
Main1
Main1
Main1
Main1
Move
Main1
Note: The x and y values for the Destroy instances at a position action requires a little trial and error so that the
relevant parts of the room are 'destroyed'.
Events/Actions Summary
The sequence of events and actions in the objTrigger object will result in the objBomb object being transformed
into the objExplode object and the bomb being removed. The objExplode sequence of events and actions will
result in the explosion causing any objects in the vicinity to be destroyed. The animation end event is to ensure
that the animated explosion sequence doesn't repeat forever.
32 | P a g e
Name
Transparent
life.gif
sprHeart
Yes
SOUNDS - LIFE
2. Add the following sound:
File
Name
life.wav
sndLife
Player right
Player down
Player up
To take this into account, we will need to create additional events and actions. Using the table below, add the
new events and actions to the objPerson object:
Event
create
keyboard <left>
keyboard <right>
33 | P a g e
Action List
Action
Settings
Main1
Main1
Control
Move
Main1
Control
Move
keyboard <down>
Main1
Control
Move
Main1
Control
Move
4. Using the table below add the following additional events/actions to the objLife object:
Event
collision objPerson
Action List
Action
Settings
Score
Main1
Main1
Events/Actions Summary
The sequence of events and actions in the keyboard events for the objPerson object will result in the relevant
subimage displaying when the player is facing left, right, up or down. The objLife collision with the player will
result in an extra life being added to the game.
ROOMS ADDITIONAL
16. Add four more rooms using the settings listed. Ensure that all rooms have the main_controller placed in the
bottom left-corner as well.
Hint: To save yourself time you can duplicate the rooms. Right-click on the room then select Duplicate
34 | P a g e
17. Ensure that the rooms are in the following order: room_start, room1, room2, room3, room4, room5, room6.
18. Save the game and test.
35 | P a g e
Resource Files
The files needed for this tutorial are located in the Lecture Resources/Resources 3 directory in the Game Maker
folder that was copied earlier.
Name
Remove Background
ring.gif
sprRing
Yes
Action List
Action
Settings
Main1
Score
Collision, objPerson
4. Add the following room to the game using the same settings as the other rooms. Make up your own caption:
36 | P a g e
Action List
Action
Settings
Main1
keyboard, letters, N
keyboard, letters, P
keyboard, letters, R
Main1
Main1
Transition optional
Main1
Transition optional
Score
draw
Score
Draw
Colour: yellow
Score
Draw
Score
Events/Actions Summary
The sequence of events and actions in the keyboard events for the main_controller object will give the user
some basic cheats when playing the game. If they press the letter N it will go to the next room (if it exists).
When the P letter is pressed it will go to the previous room and R will restart the current room. The draw event
will display the score and lives.
GAME INFORMATION
6. The game information section in Game Maker can be used to create a basic user's help guide. Double-click
the Game Information (
) button then type the following:
37 | P a g e
7. Further customisation of the game can be made in the game settings dialog. Double-click the Global
Settings
button and modify the Other tab as shown below:
38 | P a g e