Game Development Reference
In-Depth Information
2.
Select the Export For Actionscript option in the Custom menu.
3.
The first thing you will see is a warning that explains what you are going to be
exporting is simply a flattened version of the map of the current layer; no animation will
be exported. We did not create any animated tiles, but Mappy can do this and many
other things we do not have space to cover.
4.
Click OK, and type in a name for the .as file. For this example, use level1_back.as .
Click Save.
5.
Next, it will ask you how much to adjust the map values. This is an important question
because Mappy added that extra blank tile to the beginning of our tile sheet. Because
of this, the actual map values are 1 greater than they will be when we use the original
tiles.png file as our source for tiles in Flash. For that reason, put -1 into this dialog
box, and click on the OK button.
The ActionScript exported for this map will look something like this:
var map = [
[26,24,25,0,26,26,26,26,26,0,0,26,26,26,26,26,0,24,25,26],
[27,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27],
[29,0,28,0,0,0,24,25,0,24,25,0,24,25,0,0,0,27,0,29],
[27,0,28,0,27,0,0,0,0,0,0,0,0,0,0,27,0,29,0,27],
[29,0,0,0,29,0,0,30,0,0,0,0,31,0,0,29,0,0,0,29],
[0,0,28,0,26,0,0,31,0,0,0,0,31,0,0,26,0,26,0,0],
[0,0,0,0,0,0,0,31,0,0,0,0,31,0,26,0,0,0,0,0],
[26,26,26,0,0,26,0,30,30,30,30,30,30,0,0,0,0,26,26,26],
[0,0,0,26,0,0,0,0,0,0,0,28,0,0,0,0,26,0,0,0],
[0,0,0,0,26,0,0,27,0,27,0,27,0,28,0,26,0,0,0,0],
[27,0,0,0,27,0,0,29,0,29,0,29,0,28,0,27,0,0,0,27],
[29,0,0,0,29,0,0,0,0,0,0,0,0,0,0,29,0,0,0,29],
[27,0,0,0,0,26,0,28,0,28,0,28,28,0,26,0,0,0,0,27],
[29,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29],
[26,24,25,0,0,26,26,26,26,0,0,26,26,26,26,0,0,24,25,26]
]
Exporting the sprite layer
Here are the steps for exporting the sprite layer:
1.
Select the sprite layer (layer 1) from the Layer menu.
2.
Select the Export For ActionScript option in the Custom menu.
3.
The first thing you will see is a warning that explains what you are going to be exporting
is simply a flattened version of the map of the current layer; no animation will be
exported. We did not create any animated tiles, but Mappy can do this and many other
things we do not have space to cover.
4.
Click OK, and type in a name for the .as file. For this example, use level1_sprites.as .
Click Save.
Search WWH ::




Custom Search