Ejemplo n.º 1
0
 def __init__(self, loaderLayer, loaderTileMap, map):
     """
     Creates a GameTileLayer from the data structures
     U{tiledtmxloader<http://pygame.org/project-map+loader+for+'tiled'-1158-.html>} makes.
     
     @type  loaderLayer:      L{TileLayer<tiledtmxloader.TileLayer>}
     @param loaderLayer:      Layer data structure from the loader.
     
     @type  loaderTileMap:    L{TileMap<tiledtmxloader.TileMap>}
     @param loaderTileMap:    Map data structure created by the loader.
     
     @type  map:              C{str}
     @param map:              File path to the map this layer is in.
     """
     
     # tile dimensions
     self._tileWidth = loaderTileMap.tilewidth
     self._tileHeight = loaderTileMap.tileheight
     
     # the tiles
     self._tileMatrix = list()
     
     # tile layer properties
     self._animated = False
     if loaderLayer.properties.has_key(Constants.EditorConstants.LAYER_PROP_ANIMATED) and loaderLayer.properties[Constants.EditorConstants.LAYER_PROP_ANIMATED] == 'true':
         self._animated = True
     
     GameLayer.__init__(self, loaderLayer, loaderTileMap, map)
Ejemplo n.º 2
0
 def __init__(self, loaderObjGroup, loaderTileMap, map):
     """
     Creates a GameObjectLayer from the data structures
     U{tiledtmxloader<http://pygame.org/project-map+loader+for+'tiled'-1158-.html>} makes.
     
     @type  loaderObjGroup:    L{MapObjectGroup<tiledtmxloader.MapObjectGroup>}
     @param loaderObjGroup:    Layer data structure from the loader.
     
     @type  loaderTileMap:     L{TileMap<tiledtmxloader.TileMap>}
     @param loaderTileMap:     Map data structure created by the loader.        
     
     @type  map:               L{GameMap<Map.GameMap.GameMap>}
     @param map:               The L{GameMap<Map.GameMap.GameMap>} this layer is in.
     """
     
     self._spawnList = []
     
     GameLayer.__init__(self, loaderObjGroup, loaderTileMap, map)