Graphics Programs Reference
In-Depth Information
The purpose of the cleanUp() function is to clean up the game frame so that the win
and lose frames can be displayed without any leftover artifacts like extra asteroids.
Since the mouse has been hidden during game play, we need to bring it back at the
end of the game. The target cursor is reset to its original depth. Most importantly, the
asteroids need to be removed so they don't continue. As an extra precaution, the vis-
ibility of the asteroids is also set to false.
You can expand this game in any number of directions. Currently the game play is
rather simple. Either you win or you die. Think about creating a multilevel game. Start
with a beginner's level and gradually work up to an advanced level. For each level, the
number of asteroids could change as well as the time limit. Instead of asteroids, think
of adding other enemies to the game. You could also add ways to refuel or repair the
ship. This could be accomplished through a keypress or other items floating in space.
The possibilities are limited only by your creativity.
This completes one game. Let's take a look at another. Instead of objects moving at
you, Project 2 will move a “camera” towards the objects in a driving game. We will also
change the user interaction from mouse to keyboard input.
Project 2: Test Drive
This project uses vector shapes to create a driving game. It expands on the 3D cam-
era concepts discussed in Chapter 7. The player will control a racing car's movement
through an obstacle course. The obstacles are placed in 3D space, and a “camera”
moves through this space using keypress events.
Open 02_testDrive.fla in the Chapter 11 folder. Publish the movie to see the game.
The Flash file is divided into three scenes— intro , game , and score . Scenes in Flash
help organize content in the main Timeline. You can access each scene through the
drop-down menu in the Timeline (Figure 11.8). There is also a Scene panel that can
be opened by choosing Window > Other Panels > Scene. This panel allows you to add,
duplicate, rearrange, and delete a scene.
Figure 11.8 Accessing different scenes in Flash
Search WWH ::




Custom Search