Clickball: Introduction To Game Maker
From GMpedia.org Wiki
|
This tutorial works with... |
|
Build a basic game in 50 simple steps.
Contents |
[edit] Make a wall sprite and a ball sprite
- Add > Add Sprite > Load Sprite Button > Maze Folder > wall.gif > Open
- Name the sprite sprWall
- Uncheck the Transparent checkbox for the wall sprite, since there is no background
- Add > Add Sprite > Load Sprite Button > Maze Folder > ball_blue.gif > Open
- Name the sprite sprBlueBall. Keep the Transparent checkbox checked for the blue ball sprite to keep the background transparent
[edit] Add a sound
- Add > Add Sound > Load Sound Button > Sound Folder > beep1.wav > Open
- Test the sound by pressing the green play button
- Name the sound beep1
[edit] Create wall and ball objects
- Add > Add Object
- In the Objects Properties box pick the sprWall sprite from the pull down menu, as shown in the screenshot
- Name the object objWall
- Check the solid check box
- Click OK to close
- Add > Add Object
- In the Objects Properties box pick the sprBlueBall sprite from the pull down menu
- Name the object objBlueBall
- Check the solid check box
Keep the Object Properties window of the ball object open
[edit] Program Events
In the middle of the ball Object Properties window you'll see the Add Event button
- Click the Add Event button
- 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)
- From the move tab choose the Action with the 8 red arrows and drag it to the list in the middle
- Now click all of the 8 arrows to randomize the initial motion
- Change the speed to 2
- Click OK to close
Keep the Object Properties window open
[edit] Collision of the ball with the wall
- Click Add Event and this time choose Collision from the Event Selector
- From the drop down menu of the Collision Event select objWall
- 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
- Don’t change anything, just click OK
[edit] User interaction
The user will attempt to click on the moving balls with the left mouse button
- Add Event > Event Selector > Mouse > Left button
- From the actions on the right hand side click on the main1 tab
- Drag “play a sound” to the middle
- Select the beep1 sound from the pull down menu
Find Set the Score on the Score tab on the right hand side
- Drag Set the Score to the action list in the middle
- 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
- Click on the move tab on the right hand side
- Find the jump to a random position button on the right and drag it to the list in the middle. Click OK.
[edit] Define a room
- Add > Add Room
- Click on the Settings tab of Room Properties
- Make Width: 240 and Height: 240
- Set both SnapX and SnapY to 24, because the wall sprite has both a width and height of 24
- In the Caption box type in Level one
- Click on the Objects tab of Room Properties
- Select the wall object from the pull down menu
- By left clicking in the room place a wall object in there
- Keep clicking to build the whole wall around the room. To build the wall quickly try shift + hold down left mouse button + drag mouse.
- Use the right mouse button to remove bits of the wall you don't want
- Finally place 2 ball objects in the room
[edit] Play the game
- Press the Run Game green arrow
- Click on the moving balls with the left mouse button and see what happens
- Stop the game by pressing the <Esc> key
- Save your game if you haven’t already, call it something like clickball1.gm6 and show it to the teacher for marking
CONGRATULATION, YOU HAVE MADE YOUR FIRST GAME!
[edit] RESOURCES
Portions of this article were assimilated from the content at Clickball.
Feel free to continue to modify and expand this page, but please leave this notice and any licence notices in-tact.
Feel free to continue to modify and expand this page, but please leave this notice and any licence notices in-tact.
This content is licensed under the Creative Commons Attribution-NonCommercial 2.0 license.

