Beispiel #1
0
    """

    # for platformer maps
    def toWorld(data, (x, y, z)):
        """ translate tiled map coordinates to world coordinates """
        return z, x*data.tilewidth, (y-1)*data.tileheight

    # for zelda-style games
    #def toWorld(data, (x, y, l)):
    #    """ translate tiled map coordinates to world coordinates """
    #    return y*data.tileheight, x*data.tilewidth, l


    area = PlatformArea()
    parent.add(area)
    area.setParent(parent)
    area.mappath = res.mapPath(mapname)
    data = tmxloader.load_tmx(area.mappath)

    for gid, prop in data.tile_properties.items():
        try:
            prop['guid'] = int(prop['guid'])
        except KeyError:
            pass

    props = data.getTilePropertiesByLayer(-1)

    """
    print "GID MAP:"
    for k in sorted(data.gidmap.keys()):
        print "  {}: {}\t{}".format(k,