Name: ___________________________________________ 41 Lesson 3 Click Ball Copyright Goodheart-Willcox Co., Inc. May not be reproduced or posted to a publicly accessible website. 27. Click in the Columns text box, and enter 18. This specifies 18 vertical columns of instances. 28. Make sure the Row Spacing and Column Spacing values are 0. This means there will be no space added between the instances. 29. Click the OK button to add the instances. Since there is one row and 18 columns, 17 instances of the object are created in the same row as the original for a total of 18 objects. The top wall is now complete. You will add the programming for it later. 30. Applying what you have learned, duplicate the Wall_Right object so there is a total of 13 objects to complete the right-hand wall. Window Selection A marquee is a window or box dragged around a set of objects to select them. Any object completely contained inside the window will be selected. Any object not completely inside the window will not be selected. If even one pixel of the object is outside of the selection, it will be excluded. 31. Move the cursor around the game frame, and look at the coordinate indicator at the bottom-right corner of the screen. Notice how the values show you the exact X and Y location of the cursor. 32. Move the cursor to position (650,30) using the coordinate indicator to properly position it. 33. Click and drag to create a marquee that will completely include all of the Wall_Right objects, but not the Wall_Corner objects. 34. With the 13 Wall_Right objects selected, click the Copy button on the Standard Toolbar. 35. Click the Paste button on the Standard Toolbar. The cursor changes to a large plus sign to indicate content is ready to be pasted. 36. Move the cursor below the Wall_Corner_Top_Left object, and click to paste the copied objects. The pasted objects remain selected. 37. If needed, drag the pasted objects into place if they were not perfectly aligned when you clicked. 38. Applying what you have learned, copy the Wall_Top objects, and paste them at the bottom edge of the game frame. There should now be a complete wall along the outside of the game frame. Ball Movement 39. Select the Ball_Tennis object, and click the Movement tab in the Properties toolbar. 40. Click the Type property, and click Bouncing Ball in the drop-down menu that is displayed, as shown in Figure 3-4. 41. Make sure the Moving at start property is checked. This makes the ball start moving when the frame opens. 42. Change the Speed property to 40, and leave all other values at the defaults. Note: the Randomizer and Security properties are used to keep the ball from getting stuck. These will randomly change the direction of the ball to avoid these issues. Increasing these values will create a more random movement that is harder to predict. Copy Paste Movement Number of horizontal rows Number of vertical rows Distance between rows Distance between columns Goodheart-Willcox Publisher Figure 3-3. When creating instances, specify the number of rows and columns as well as the distance between.
Previous Page Next Page