Name: __________________________________________
Copyright
by
The
Goodheart-Willcox
Co.,
Inc.
Lesson 3 Click Ball 43
150. For the OBJ_Ball object, add programming below the existing 10 point victory condition
action: IF the score equals 20, THEN move to the next room.
151. Save your work.
Level 4: The End
At the end of the game, the player should see some sort of congratulations. You will create
this as a custom sprite with text.
152. Click the Create a Sprite button on the toolbar. The Sprite Properties dialog box is
displayed.
153. In the Name: text box, enter SPR_EndText.
154. Click the Edit Sprite button to create an image from scratch. The Sprite Editor is
displayed.
155. Click the Create New Sprite button on the Sprite Editor toolbar to display the Create
a New Sprite dialog box. Note: this dialog box may be automatically displayed when the
Sprite Editor is launched. Change the Height: and Width: settings to 100 and click the
OK button.
A square canvas with a checkerboard pattern is displayed in the Sprite Editor. The
checkerboard pattern represents transparent parts of the image and will not be part of the final
image. Double-click on the checkerboard canvas to open the Image Editor. The Image Editor
is used to create custom drawings and images, much like Microsoft Paint.
156. Notice the color palette on the right-hand side of the Image Editor. The Left: sample
color is what will be used for the text, so left-click on a color swatch, such as the yellow
swatch, in the palette below to set the color of the text. Right-clicking will set the color for
the Right: sample.
157. Click the Draw Text button. The Font area is displayed below the buttons, Figure 3-16.
158. Click the Aa button in the Font area to display a standard Windows font selection dialog
box.
159. Enter 20 in the Size: text box, and enter Bold in the Font style: text box. You can also
make selections in the corresponding lists.
160. Click the OK button to close the font selection dialog box and return to the Image Editor.
161. Click anywhere on the image canvas (the checkerboard section) to begin placing the
words. The Drawing a Text dialog box is displayed, Figure 3-17.
162. In the Drawing a Text dialog box, type a phrase, such as Congratulations!#You are
a#WINNER! The pound sign (#) indicates where a new line will start.
163. Click the OK button in the Drawing a Text dialog box to place the text onto the canvas.
Notice that the words do not fit on the canvas. Game Maker is not very friendly with
text. So, the best thing to do is undo the text placement, then either resize the canvas or use a
smaller text size. For this example, you will resize the canvas.
164. Click the Undo button on the Image Editor toolbar to remove the text.
Create a
Sprite
Draw
Text
Undo
Previous Page Next Page