예제 #1
0
class TiledMapHandler(MapHandler):
    
    # 4 gives better FPS at resolution 320x320, but can cause loading hiccups
    # 2 gives smoothest loading, highest cache hits
    collapse_level = (2,2)
    
    def load(self):
        self.map = TiledMap(
            data.filepath('map',self.map_file), collapse=self.collapse_level)
    
    def collapse(self, clevel):
        if clevel > (1,1):
            self.collapse_level = clevel
            # self.map could be None if the map isn't loaded or has been
            # unloaded.
            if self.map:
                self.map.collapse(clevel)
예제 #2
0
 def load(self):
     self.map = TiledMap(
         data.filepath('map',self.map_file), collapse=self.collapse_level)