Name: __________________________________________
Copyright
by
The
Goodheart-Willcox
Co.,
Inc.
Lesson 3 Click Ball 45
171. Click the Center Align button in the Font section.
172. Click the Close the Image Editor, saving the changes made button (green check
mark) to close the Image Editor.
173. In the Sprite Editor, click the OK, save changes button (green check mark) to close
the Sprite Editor. Also, close the Sprite Properties dialog box, saving the changes
when prompted.
174. Create a new object, name it OBJ_EndText, and assign the SPR_EndText sprite to it.
175. Create a new room (room3), which will be the room displayed when the player completes
the game.
176. In the Room Properties dialog box for room3, add a background image of your choice to
the room, but it should complement the yellow text.
177. Add the OBJ_EndText object to the room and place it in the center.
178. Open the Object Properties dialog box for the OBJ_Ball object. Add the programming
needed to move the player from room2 to room3 when the score is 20.
Now, the game has a victory condition for each level and the player receives a message
when the game is successfully completed. However, on the final screen, there should be a way
for the player to either replay the game or end the game. To do this, you will add Quit and Play
buttons to the final screen (room3).
179. Create a new sprite, name it SPR_Quit, and assign the button_quit.png image fi le to it.
This image fi le is located in the Game Maker Sprites Buttons folder.
180. Create a new sprite, name it SPR_Play, and assign the button_play.png image fi le to it.
This image fi le is also located in the Game Maker Sprites Buttons folder.
181. Create a new object, name it OBJ_Quit, and attach the SPR_Quit sprite to it.
182. Create an event: IF the player clicks the left mouse button. Remember how you did this
for the OBJ_Ball object?
183. Create an action: THEN end the game. Remember how you did this to end the game
before you added additional rooms?
184. Create a new object, name it OBJ_Play, and attach the SPR_Play sprite to it.
Uncheck
Change the width
Figure 3-18
Center
Align