Video Game Design and Programming Concepts 46 Copyright Goodheart-Willcox Co., Inc. May not be reproduced or posted to a publicly accessible website. 74. Click the Single click radio button to set how the user must click. 75. Click the OK button, and a dialog box is displayed for selecting which object the user must click. 76. Click the icon for the Ball_Tennis object, and then click the OK button to complete the condition. The pseudocode for the condition is: IF the user clicks with the left mouse button on the Ball_Tennis object. 77. Right-click in the cell where line 3 under the Player 1 icon, and click Score Add to Score in the shortcut menu. 78. Applying what you have learned, enter 1 in the expression editor, and click the OK button. 79. Examine line 3 to make sure the programming matches this pseudocode: IF the user click with the left button on the Ball_Tennis object, THEN add 1 to the score for player 1. 80. Run the frame. To test, left-click the ball object and see if the score increases by 1 each time. Note: when the score reaches 10, the game window will close. Sound You now have all three elements of a simple video game, but the game needs a little tuning. Tuning is improving the game. Start tuning by adding some sound to let the player know when the ball has been clicked and a point awarded. Sounds can be obtained from almost any source or even recorded on your own. You must, however, be mindful of copyrights. When using sounds that you did not create yourself, you must make sure that these sounds are free to use and are not protected by copyright. Clickteam Fusion 2.5 comes with some sound files you can use. 81. Display the event editor. 82. Right-click in the cell on line 3 below the Sound icon, and click Samples Play Sample from the shortcut menu. The Play Sample dialog box is displayed, as shown in Figure 3-10. 83. Make sure the Uninterruptable check box is not checked. Then, click the Browse button to the right of the From a file label. A standard open-type dialog box is displayed. 84. Navigate to the folder where the sound files installed with Clickteam Fusion 2.5 are located. This is typically C:\Program Files (x86)\Clickteam Fusion 2.5 Free Edition\Samples. 85. Select the BALL6.WAV file in the folder, and click the Open button to finish adding the action. Run Frame Sound file loaded into the application Click to select a sound file Goodheart-Willcox Publisher Figure 3-10. Sound files can be loaded into the application to be played in the game.
Previous Page Next Page