Spot the Difference

In this chapter, you will make a basic Spot the Difference game. The coding is quite simple, and it’s a great way to start exploring the IDE. All of the images used in the game are available in the Resources folder that you downloaded. This project uses a

  • PDF / 6,204,695 Bytes
  • 47 Pages / 504 x 720 pts Page_size
  • 39 Downloads / 212 Views

DOWNLOAD

REPORT


Spot the Difference In this chapter, you will make a basic Spot the Difference game. The coding is quite simple, and it’s a great way to start exploring the IDE. All of the images used in the game are available in the Resources folder that you downloaded. This project uses a background image and instances of an object to mark where the differences are, plus a control object for keeping track of the player’s progress. The aim of this game is for the player to find all of the differences between two images before time runs out. When you start GMS2, you will be presented with the start screen shown in Figure 1-1.

© Ben Tyers 2018 B. Tyers, Practical GameMaker Projects, https://doi.org/10.1007/978-1-4842-3745-8_1

1

Chapter 1

Spot the Difference

Figure 1-1.  The Start screen

2

Chapter 1

Spot the Difference

Click New, as shown in Figure 1-1, and then select GameMaker Language, as shown in Figure 1-2.

Figure 1-2.  Starting a GameMaker Language project

3

Chapter 1

Spot the Difference

Next, give the project a name, for example spot, as shown in Figure 1-3.

Figure 1-3.  Setting a name for a project

4

Chapter 1

Spot the Difference

You will be presented with a screen like the one shown in Figure 1-4.

Figure 1-4.  The initial start screen This may look a little daunting at first, but don’t worry; after you have completed the first five chapters of this book, you will be comfortable enough to find your way around this screen. If the Resources tab is not shown on the right of the window, you can click Windows in the top menu and then Resources.

5

Chapter 1

Spot the Difference

This game of Spot the Difference uses four images, so load them now. In the Resources tab, right-click Sprites and then Create Sprite, as shown in Figure 1-5.

Figure 1-5.  Creating a new sprite

6

Chapter 1

Spot the Difference

Next, name the sprite bg_1 and click Import, as shown in Figure 1-6.

Figure 1-6.  Naming the sprite and importing it Navigate to the Resources folder and load in Spot_Level_1, as shown in Figure 1-7.

7

Chapter 1

Spot the Difference

Figure 1-7.  Loading in a sprite When the dialog pops up, click Yes, as shown in Figure 1-8. You can also check the “Don’t show the message again” box, also shown in Figure 1-8.

Figure 1-8.  Dialog pop-up 8

Chapter 1

Spot the Difference

Your screen will look something like Figure 1-9.

Figure 1-9.  A sprite loaded in Now, save and close this window. There are a few ways to do this. The first is to drag the window title with the left mouse button held down and then click the X. The second is to hold down the middle mouse button in an empty area and drag the workspace contents so you can see the close X box, as shown in Figure 1-10, and click it.

9

Chapter 1

Spot the Difference

Figure 1-10.  One method of closing a window You can also right-click the window bar and select Close, as shown in Figure 1-11.

Figure 1-11.  The other method of closing a window

10

Chapter 1

Spot the Difference

Now, create a new sprite named bg_2 and load in another resource so it

Data Loading...