Clickball: Introduction To Game Maker

Build a basic game in 50 simple steps.

Make a wall sprite and a ball sprite

 * 1) Add > Add Sprite > Load Sprite Button > Maze Folder > wall.gif > Open
 * 2) Name the sprite sprWall
 * 3) Uncheck the Transparent checkbox for the wall sprite, since there is no background
 * 4) Add > Add Sprite > Load Sprite Button > Maze Folder > ball_blue.gif > Open
 * 5) Name the sprite sprBlueBall. Keep the Transparent checkbox checked for the blue ball sprite to keep the background transparent

Add a sound

 * 1) Add > Add Sound > Load Sound Button > Sound Folder > beep1.wav > Open
 * 2) Test the sound by pressing the green play button
 * 3) Name the sound beep1

Create wall and ball objects

 * 1) Add > Add Object
 * 2) In the Objects Properties box pick the sprWall sprite from the pull down menu, as shown in the screenshot
 * 3) Name the object objWall
 * 4) Check the solid check box
 * 5) Click OK to close
 * 6) Add > Add Object
 * 7) In the Objects Properties box pick the sprBlueBall sprite from the pull down menu
 * 8) Name the object objBlueBall
 * 9) Check the solid check box

Keep the Object Properties window of the ball object open

Program Events
In the middle of the ball Object Properties window you'll see the Add Event button
 * 1) Click the Add Event button
 * 2) Click Create from the Event Selector pop up menu.  On the right hand side you'll see all the possible actions in a number of groups (tabs)
 * 3) From the move tab choose the Action with the 8 red arrows and drag it to the list in the middle
 * 4) Now click all of the 8 arrows to randomize the initial motion
 * 5) Change the speed to 2
 * 6) Click OK to close

Keep the Object Properties window open

Collision of the ball with the wall

 * 1) Click Add Event and this time choose Collision from the Event Selector
 * 2) From the drop down menu of the Collision Event select objWall
 * 3) From the actions on the right select the bounce against objects icon and drag it to the list in the middle.  A window will pop up, called bounce against objects
 * 4) Don’t change anything, just click OK

User interaction
The user will attempt to click on the moving balls with the left mouse button


 * 1) Add Event > Event Selector > Mouse > Left button
 * 2) From the actions on the right hand side click on the main1 tab
 * 3) Drag “play a sound” to the middle
 * 4) Select the beep1 sound from the pull down menu

Find Set the Score on the Score tab on the right hand side


 * 1) Drag Set the Score to the action list in the middle
 * 2) For the score action, type in the value of 1 and check the Relative box. This means that 1 is added to the current score for each successful mouse click

Stay on the left button Event


 * 1) Click on the move tab on the right hand side
 * 2) Find the jump to a random position button on the right and drag it to the list in the middle. Click OK.

Define a room

 * 1) Add > Add Room
 * 2) Click on the Settings tab of Room Properties
 * 3) Make Width: 240 and Height: 240
 * 4) Set both SnapX and SnapY to 24, because the wall sprite has both a width and height of 24
 * 5) In the Caption box type in Level one
 * 6) Click on the Objects tab of Room Properties
 * 7) Select the wall object from the pull down menu
 * 8) By left clicking in the room place a wall object in there
 * 9) Keep clicking to build the whole wall around the room. To build the wall quickly try shift + hold down left mouse button + drag mouse.
 * 10) Use the right mouse button to remove bits of the wall you don't want
 * 11) Finally place 2 ball objects in the room

Play the game

 * 1) Press the Run Game green arrow
 * 2) Click on the moving balls with the left mouse button and see what happens
 * 3) Stop the game by pressing the  key
 * 4) Save your game if you haven’t already, call it something like clickball1.gm6 and show it to the teacher for marking

CONGRATULATIONS, YOU HAVE MADE YOUR FIRST GAME!

RESOURCES
Game Maker official site

National forum

Kerr web site

Forster club

EdNA groups

Game Maker Forum