Game Development Reference
In-Depth Information
Figure 8-8. Instance names of objects inside the DungeonOne symbol
Laying out the level
The objects and level layout of Dungeon Maze Adventure are designed within a 50-by-50 pixel grid.
To switch on the grid view in Flash, select View ° Grid ° Edit Grid and chose your grid size. Make
sure that Show Grid and (optionally) Snap to Grid are selected. Designing levels for your games is often
much easier if you work within a grid layout.
All the objects that require collision detection, such as the player, enemies, and walls are centered in
the middle of their symbol editing windows. This makes calculating their half-widths and half-heights
much easier.
It can sometimes be easier to create a game level layout if you switch on pixel snapping , which forces
Flash's vector objects to conform to fixed pixel widths. Without pixel snapping, objects could have irregular
widths and heights, such as 55.3 or 12.1. The problem with this is that when the objects are rendered in the
SWF file, these fractional widths and heights will be rounded off to the nearest pixel, which means that an
object might end up being wider or narrower by one pixel than you thought it was when you designed it.
Switching on pixel snapping solves this problem by forcing vector objects to fixed, whole pixel sizes when
you design them. You can switch on pixel snapping by selecting View ° Snapping ° Snap to Pixels .
 
Search Nedrilad ::




Custom Search