Click It Game

If you open a new game, it has nothing in it...

You will need to open the starting file in your Z: > GameMaker folder.

  1. Click on This PC
  2. Then scroll down to find Z:
  3. Double-click on Z: to open that folder.

In Z: double-click on the GameMaker folder...

Open the Click It game file

Use the starting file! This file already has sprites, sounds and backgrounds ready to go. If you click on the "+" to the left of the folders, they expand to show you this...


1. Balls Moving & Bouncing

wall

To create a new object, you can click on the button on the toolbar at the top...

or right-click on the Objects folder and create a new object...

Name it wall. Set to wall sprite; make it solid.

No events/actions for this; they just sit in the room.

balls moving

Right-click on the Objects folder again to create another new object...

Call it ball. Give it the ball sprite.

Add a new event: Create (what happens when the room loads)...

Drag the Move Fixed action into the Actions area and let go...

In the action window that opens up, set the ball to move in all directions (except center), speed 8.

So now your ball object looks like this so far...

balls bouncing off walls

Add another event: Collision with wall

First add a Bounce action...

Can leave default settings (set to solid objects, so it'll bounce off the wall object which is solid but not other balls).

Also we should add Play Sound action...

In the window that opens, use the drop-down menu to set the sound to play "bounce".

When you say OK, your Collision with wall event looks like this...

You can say OK to the ball object to close it for now.

Room

To create a room, either right-click on the Rooms folder, or use the tool button at the top.

The first thing you need to do is change the grid size...

Set grid 32x32.

Add a Background picture.

To design your room, you have to make sure you're seeing all of it. First maximize the window...

Resize your GameMaker program window if you're not seeing all of it.

Now go to the Objects tab and click anywhere near the top to choose the wall object...

Line the outside of your room with the wall object (hold SHIFT and left-click and drag)

Place about 5-10 ball objects in your room.

Test the game (F5). 

  • Do the balls move on their own
  • stay in the walls?
  • move randomly?

If yes, then move on to the next steps; if not, go back and fix/get help. You can also close the room for now by clicking on the green check mark in the top left corner.


2. Score

get points for clicking on balls

Go back into your ball object by double-clicking on the object in the Objects list...

Add the Left button event (under Mouse events)...

Add action: Play Sound = "click"

Add action Set Score ...

In the window that opens up, check the box for relative (so it keeps going up) and the amount to 10 so the player gets 10 points each time they click on a ball.

Now add the action Jump to Random position (default settings). This is so that each time the player clicks on a ball, it starts over in a new random place (otherwise the game would be too easy, you could just hold down the mouse on a ball and have your score rack up!)

Your Left button event should look like this...

Test your game (F5) and click on some balls. You should see the score in the caption area of your window.


3. Bad guy

badguy (lose points)

Create an object that also bounces around but when the player click on it, they lose double points. Instead of creating this object from scratch, you can make a copy of the ball object and change a couple things.

 

First, right-click on the ball object and "Duplicate".

Change the name to "badguy" and choose a different sprite/image.

Under the Left Button event, double-click on the following actions and change the settings:

  • Play Sound: change the sound to your "badman" sound
  • Set Score: change the score to go down by double the amount of points (-20)

Room

Go into your room. Select the badguy object and place a few in the room. Then test your room and see if it works.


4. Ending the game

To end the game we need to test when the game would be over - maybe when the player reaches a certain score. 

controller

Create a new object controllerNo sprite; it's invisible, sits in the background.

Add a new Step event ( just use the default one); this will continuously check for the action we set next...

We will first test how many points the player has using the Test Score action...

Since this is a simple game and we just want to get the idea, we'll test if the score is larger than 100.

 

If it's true, then you want it to do both of the following actions (so you need to put start and end blocks around it)...

 

 

    • Display a Message - type in something like "Congratulations"
    • End the Game

So your controller object should look like this.

Room

In order for this to work, you have to place the object somewhere in your room - it doesn't matter where (it's invisible), just don't replace an object you already have...

Test your game. When you have 100 points and click on the next ball, you should get the pop up window. When you click "OK", the game should close.