Beispiel #1
0
    for k in sorted(data.gidmap.keys()):
        print "  {}: {}\t{}".format(k,
                                    data.gidmap[k],
                                    data.getTilePropertiesByGID(data.gidmap[k]))
    """

    # load the level geometry from the 'control' layer 
    rects = []
    for rect in buildDistributionRects(data, "Control", real_gid=1):
        rects.append(Rect(rect))

    area.setLayerGeometry(0, rects)


    # build 'raw geometry'
    area.rawGeometry = []
    for rect in rects:
        y, z = rect.topleft
        bbox = BBox((-100, y, z, 200, rect.width, rect.height))
        area.rawGeometry.append(bbox)


    # load the npc's and place them in the default positions 
    npcs = [ p for p in props if p[1].get('group', None) == 'npc' ] 

    for (gid, prop) in npcs:
        pos = data.getTileLocation(gid)
        if len(pos) > 1:
            msg = "control gid: {} is used in more than one locaton"
            raise Exception, msg.format(gid)