code: def draw(self, surface):
          
          ox, oy = self._map_layer.get_center_offset()
  
          new_surfaces = list()
          spritedict = self.spritedict
          gl = self.get_layer_of_sprite
          new_surfaces_append = new_surfaces.append
  
          for spr in self.sprites():
              new_rect = spr.rect.move(ox, oy)
              try:
                  new_surfaces_append((spr.image, new_rect, gl(spr), spr.blendmode))
              except AttributeError:  # generally should only fail when no blendmode available
                  new_surfaces_append((spr.image, new_rect, gl(spr)))
              spritedict[spr] = new_rect
  
          self.lostsprites = []
          return self._map_layer.draw(surface, surface.get_rect(), new_surfaces)
docs: Draw all sprites and map onto the surface
  
          :param surface: pygame surface to draw to
          :type surface: pygame.surface.Surface