Name: __________________________________________
Copyright
by
The
Goodheart-Willcox
Co.,
Inc.
Lesson 3 Click Ball 37
87. Test play the game and see how many times you can click the ball in one minute. The
score is displayed in the title bar of the game preview. Then, close the game preview.
Cashing in on Sound
You now have the elements of a simple game, but it needs a little tuning or improvement.
Start tuning by adding some sound to let the player know when the ball has been clicked and a
point has been received. First, you need to add the sound to the resource tree.
88. Click the Create a Sound button on the toolbar. The Sound Properties dialog box is
displayed, Figure 3-11.
89. In the Name: text box, enter SND_Click. This identifi es the sound as for the click event.
90. Click the Load Sound button. A standard Windows “open” dialog box is displayed.
91. Navigate to the Game Maker Sounds folder, if it is not already displayed. Your teacher may
specify a different folder.
92. You can preview any sound in Media Player by right-clicking on the fi le and selecting Play
from the shortcut menu. Select the cash_register.wav sound fi le in the open dialog box
and click the Open button.
93. In the Sound Properties dialog box, click the Normal radio button in the Kind area.
94. In the Effect area, uncheck all check boxes so no effects will be applied.
95. Drag the Volume: slider to the far right (full volume).
96. Drag the Pan: slider to the middle position.
97. Check the Preload check box. Preloading loads the sound into the game when the
game is launched. This will help the game play smoother. Otherwise, the game will freeze
for an instant the fi rst time the sound must be played as the computer searches for, loads,
and plays the sound.
Run the
Game
Create a
Sound
Name the
sound asset
Check the
effects to apply
Set the type
of sound
Click to load
a sound
Figure 3-11