Copyright
by
The
Goodheart-Willcox
Co.,
Inc.
158 Introduction to Video Game Design
7. In a different location, place a couple of locks to block the explorer’s path.
8. Open the Object Properties dialog box for the OBJ_Lock_Gold object.
9. Program the lock object such that IF the avatar collides with the lock, THEN the avatar
movement stops.
10. Test play the game. Now the player cannot reach the exit. If you have placed the doors on
top of the exit objects and the player can still navigate to the next room, you will need to
move the doors and exit objects so the avatar collides with the doors before reaching the
exit objects.
11. Save your work.
Passage Keys
To allow the player to pass through a barrier, a passage key must be placed within the
game. The passage key need not be an actual key. It can be anything used to eliminate the
barrier. You will program two different passage keys to allow the player to get through the doors
and locks.
12. In the Level 1 room, place one instance of the gold key in a location where the player can
access it before reaching the lock barrier.
13. Open the Object Properties dialog box for the OBJ_Avatar object.
14. Program the key such that IF the avatar collides with the key, THEN destroy the key AND
destroy the locks. Since the lock barriers will be destroyed, the player can get past the
barrier.
Locks added
Doors
added
Figure 10-1
Run the
Game
Previous Page Next Page