-
Notifications
You must be signed in to change notification settings - Fork 0
Tilemaps
Lasconik edited this page Nov 9, 2014
·
4 revisions
Tilemaps are XML files containing all information required to create maps. They will contain some integers, which are in fact indexes in a tileset. Note that the tileset is not referenced in a map file: one could want to have the same map but with a different scenery.
An XML map should follow the following format (the content of LAYER can contain spaces or line-breaks if you want to improve readability):
<?xml version="1.0" encoding="UTF-8"?>
<MAP width="13" height="13" nbLayers="2">
<LAYER>
1-1-1-2-2-2-2-2-2-2-1-1-1-
1-1-2-1-2-1-2-1-2-1-2-1-1-
1-2-2-2-2-2-2-2-2-2-2-2-1-
2-1-2-1-2-1-2-1-2-1-2-1-2-
2-2-2-2-2-2-2-2-2-2-2-2-2-
2-1-2-1-2-1-2-1-2-1-2-1-2-
2-2-2-2-2-2-2-2-2-2-2-2-2-
2-1-2-1-2-1-2-1-2-1-2-1-2-
2-2-2-2-2-2-2-2-2-2-2-2-2-
2-1-2-1-2-1-2-1-2-1-2-1-2-
1-2-2-2-2-2-2-2-2-2-2-2-1-
1-1-2-1-2-1-2-1-2-1-2-1-1-
1-1-1-2-2-2-2-2-2-2-1-1-1-
</LAYER>
<LAYER>
0-0-0-0-0-0-0-0-0-0-0-0-0-
0-3-0-3-0-3-0-3-0-3-0-3-0-
0-0-0-0-0-0-0-0-0-0-0-0-0-
0-3-0-3-0-3-0-3-0-3-0-3-0-
0-0-0-0-0-0-0-0-0-0-0-0-0-
0-3-0-3-0-3-0-3-0-3-0-3-0-
0-0-0-0-0-0-0-0-0-0-0-0-0-
0-3-0-3-0-3-0-3-0-3-0-3-0-
0-0-0-0-0-0-0-0-0-0-0-0-0-
0-3-0-3-0-3-0-3-0-3-0-3-0-
0-0-0-0-0-0-0-0-0-0-0-0-0-
0-3-0-3-0-3-0-3-0-3-0-3-0-
0-0-0-0-0-0-0-0-0-0-0-0-0-
</LAYER>
</MAP>
The 0 has a special value: it means "nothing". Other indexes refere to a tile in a tileset. Tilesets start counting from the upper-left tile, going horizontally then vertically, until the bottom-right tile.