Video Game Design and Programming Concepts 50 Copyright Goodheart-Willcox Co., Inc. May not be reproduced or posted to a publicly accessible website. 120. Click the Pick button, and then click anywhere on the pink background color. The color swatch next to the button changes to indicate which color will be knocked out to make areas transparent. Note: black is the default transparent color, so if this was left unchanged, the black of the bomb would be invisible in the game, but the pink background would be visible. 121. Click the OK button to close the Import Options dialog box. 122. Click the OK button to close the image editor. 123. Applying what you have learned, rename the active object as Enemy_Bomb. 124. Change the size of the Enemy_Bomb object to 32 pixels wide and 44 pixels high. 125. Change the movement to bouncing ball with a speed of 60. 126. Copy and paste the Enemy_Bomb object so there are a total of eight enemies. 127. Randomly place the bombs around the scene. Copy and Edit Programming As you have seen, actions can be copied and pasted to speed up programming. Event lines can also be copied and pasted. Once pasted, an event can be easily edited. This increases efficiency by not having to program the entire event from scratch. 128. Open Level 2 in the event editor. 129. Right-click on the 1 for the first event line, and click Copy in the shortcut menu. 130. Right-click on the number for new condition line, and click Paste in the shortcut menu. An exact copy of the first event line is added. 131. In the condition for line 5, double-click the icon for the Ball_Tennis object. 132. In the dialog box that is displayed, click the Enemy_Bomb object, and click the OK button. The condition now tests for a collision with the Enemy_Bomb object instead of the Ball_ Tennis object. 133. Drag the check mark in line 5 from the Ball_Tennis column to the Enemy_Bomb column. 134. Right-click the check mark in the Ball_Tennis column on line 5, and click Delete in the shortcut menu. Event Editor Click and select the background color Goodheart-Willcox Publisher Figure 3-13. When importing an image file, you can select which color will be transparent (not shown) in the sprite.
Previous Page Next Page