Name: __________________________________________
Copyright
by
The
Goodheart-Willcox
Co.,
Inc.
Lesson 3 Click Ball 41
Just above the background display box, which now displays BCK_Wood, is the
Foreground image check box. The foreground is the image in front of all other images,
as opposed to the background, which is the image behind all other images. If you make
the wood the foreground, player will not be able to see the rest of the game. However, there
are some instances where you will want the “background” image to be in the foreground. For
example, if the image is a frame surrounding the playing field, you may want this image to be in
the foreground so it is always in front of other objects.
128. Check the Foreground image check box. Notice the “background” is now in front of all
other objects. Uncheck the Foreground image check box to return the background to
behind all other objects.
129. Click the Settings tab and enter Level 2 in the Caption for the room: text box.
130. On the toolbar in the Object Properties dialog box, click the Close the form, saving
the changes button (green check mark) to close the dialog box and save the changes
you made to the room.
131. Save your work.
Level 2 Modifi cations
Using skills you learned earlier, increase the difficulty for level 2. For example, you could
add some additional wall blocks to the room. This will give the ball more objects to bounce
off of, which means it will change direction more often and be harder to click. You could also
change the speed of the ball. Be creative in applying what you have already learned.
Cheat Code
A cheat code is a shortcut built into a game to help the quality assurance team and programmers
navigate through the game. This allows them to jump past certain points without having to complete the
task or level. To help you pass each level while testing your game, you will now program a cheat code.
To stop the ball, program the logic statement:
IF the player presses the space bar, THEN set the ball speed to zero.
To return the ball to normal speed, program the logic statement:
IF the player presses the [Enter] key, THEN set the ball speed back to normal.
132. Open the Object Properties window for the OBJ_Ball object.
133. Add an event for pressing the space bar. Use what you have learned to fi gure out how to do this.
134. Add an action for the event you just created that sets the ball speed to zero. Use what you
have learned to fi gure out how to do this.
135. Add an event for pressing the [Enter] key.
136. Add an action for the event you just created that sets the ball speed back to the original
speed for the level.
137. Test play the game and try out the cheat codes.
138. Save your work.
Run the
Game
Previous Page Next Page