Name: ___________________________________________ 43 Lesson 3 Click Ball Copyright Goodheart-Willcox Co., Inc. May not be reproduced or posted to a publicly accessible website. 44. Select the Wall_Corner_Top_Left object. 45. Click the RunTime Options tab in the Properties toolbar. 46. Change the Obstacle Type to Obstacle. An object can be set as a basic barrier, such as a platform, ladder, or obstacle. Most background objects are simply set to None as they are decorative and not functional. Game objects can pass over or through these objects. 47. Check the Collision with box property. This specifies the bounding box will be used for collision detection. 48. Applying what you have learned, set all the wall class objects to be obstacles with collision detection set to the bounding box. Note: you only need to change the properties of one object to change all instances of the object. Programming Events Remember, Clickteam Fusion 2.5 uses conditions and actions to create the interactions needed in a game. Your game does not yet have any programming, only scene design. The first programming event will be to make the ball bounce off any obstacle it encounters. The pseudocode for this is: IF the Ball_Tennis object collides with an obstacle, THEN bounce the Ball_Tennis object away from the obstacle. 49. Display the event editor. 50. Applying what you have learned, add a new condition. In the New Condition dialog box, right-click on the icon for the Ball_Tennis object, and click Collisions Backdrop in the shortcut menu. This creates the condition IF the Ball_Tennis object collides with an obstacle. Notice how this is displayed on the event line in the event editor. Note: only background objects set as obstacles will be detected. 51. Right-click in the cell under the icon for the Ball_Tennis object, and click Movement Bounce in the shortcut menu. This creates the action THEN bounce the Ball_ Tennis object away from the obstacle. If you hover the cursor over the check mark, the help text will indicate Bounce, as shown in Figure 3-6. 52. Run the frame to make sure the Ball_Tennis object is bouncing off the walls. Close the game frame when done testing. 53. Debug any errors by setting any wall object as an obstacle if needed. Victory Condition Recall from the reading that to be a video game requires a game environment, user interface, and victory condition. Do you think all three requirements have been met? Only one requirement has been met by setting up the scene or game environment. This game will use a score to establish a victory condition. 54. Display the frame editor. RunTime Options Event Editor Run Frame Frame Editor Condition Action Goodheart-Willcox Publisher Figure 3-6. Actions are represented by check marks in the event editor. The help text will show what the action is.
Previous Page Next Page