Game Development Reference
In-Depth Information
1.
Create an XML file for the level in Mappy.
2.
Make a copy of the Level1.as file and rename it Level2.as .
3.
Replace the Level1 map variable data with the new 2D array of tile data, exported
from Mappy with the Export to ActionScript option in the Custom menu for Level2 .
4.
Make any level-specific changes you want to the nontile variables in the file.
5. Make sure to add an instantiation for Level2 to the variable definition section of the
DriveSheSaid.as :
private var levels:Array = [undefined, new Level1(), new Level2()];
6.
Repeat this process for each of the levels you create.
Summary
We have covered a lot in this chapter, and we did it at a very rapid pace. To create this game, we
extended the BlitSprite class and used the blitting techniques that we have been evolving
throughout this topic for car-based movement and created code to move it around a scrolling tile-
based world. We created collision routines based on the tiles but also extended the collision
detection to the actual color of the pixels on each tile. The game evolved some advanced screen
render code and collision detection routines to allow free 360-degree fluid movement across the
world. We used three look-ahead points across the front and rear of the car to determine exactly
what tiles and pixel colors on those tiles the car would collide with if moved in the forward or
reverse direction. We also moved our sounds into a custom class called Library (for the Flex
SDK only) and embedded MP3 files rather than WAV files.
In the next chapter, we will up the ante and create the most optimized game in this topic. Blaster
Mines is a geometry wars-style blasting contest that will make use of a new optimized game loop
timer as well as object pooling techniques and particles for explosions.
Search WWH ::




Custom Search