Name: ___________________________________________ 47 Lesson 3 Click Ball Copyright Goodheart-Willcox Co., Inc. May not be reproduced or posted to a publicly accessible website. 86. Examine line 3 to make sure the programming matches this pseudocode: IF the user clicks with the left button on the Ball_Tennis object, THEN play the sound sample BALL6 AND add 1 point to the score for player 1. 87. Run the frame. Test that the sound plays when the ball is clicked. Note: the first time you click the ball, the game may pause for a few seconds while the sound loads. Close the game window when done testing. Sound Engineering A sound engineer is someone who locates sounds and configures them for proper use. In a video game design studio, sound engineers are responsible for all of the sounds needed in a game. You get to be the sound engineer for this game. 88. Launch a web browser, and navigate to a search engine. Search for a sound file of a ball hitting a wall. Be sure to locate a copyright-free sound file in WAV format. 89. Download the sound file to your working folder. 90. Rename the sound file as Ball_Wall_Hit using the same file extension. 91. Applying what you have learned, modify the first event line to program the sound to play with this pseudocode: IF the Ball_Tennis object collides with an obstacle, THEN play the Ball_Wall_Hit sample AND bounce the ball. 92. Test the game. Check that the sounds play correctly. Close the game frame when done testing, and replace the sounds if needed. Room for Expansion You have reached a milestone of design. A milestone of design is a key point in the process of creating a game that represents a significant event. This milestone is the first playable level. The first playable level is the prototype version of the game that actually allows someone to play and test all of the interactions in the game. The Click Ball game has reached the first playable level milestone. It is a solid game, but it could still use a little improvement. The reason why first playable level is so important is that the majority of the programming is in place. To add another level to the game is very easy. You can copy the first level and edit it to require more skill to win. To show the player that a different level is being played, the background color will be changed. 93. Display the storyboard editor. 94. Right-click the thumbnail for Level 1, and click Copy in the shortcut menu. 95. Right-click on the thumbnail again, and click Paste in the shortcut menu. An exact copy of the Level 1 frame is created. 96. Applying what you have learned, rename the second frame as Level 2. 97. Double-click the Level 2 thumbnail to open that frame in the frame editor view. 98. Applying what you have learned, change the background color to any other color of your choice. Note: avoid yellow as it will not provide enough contrast with the ball. 99. Using the skills you have learned, increase the difficulty for the Level 2 frame. For example, you could increase the speed of the ball, reduce the size of the ball, or add additional wall blocks to the frame. This would give the ball more obstacles to bounce off and change direction more often, as shown in Figure 3-11. Additionally, increasing the speed property of the ball makes it harder to track the ball and click on it. Be creative in applying what you have learned. Run Frame Run Frame Storyboard Editor
Previous Page Next Page