Tiled maps

The cocos.tiles module provides a simple method of managing tiled displays in 2D games.

Tile maps are made of three components:

images
Images are from individual files for from image atlases in a single file.
tiles
Tiles may be stand-alone or part of a TileSet.
maps
MapLayers are made of either rectangular or hexagonal Cells which reference the tiles used to draw the cell.

The intent is that you may have a tile set defined in one XML file which is shared amongst many map files (or indeed within a single XML file). Images may be shared amongst multiple tiles with the tiles adding different meta-data in each case.

These may be constructed manually or loaded from XML resource files which are used to store the specification of tile sets and tile maps. A given resource XML file may define multiple tile sets and maps and may even reference other external XML resource files. This would allow a single tile set to be used by multiple tile maps.

A fairly simple example of using the cocos.tiles module is provider in test/test_tiles.py

A basic tile map editor is provided in tools/editor.py