code: def _initialize_buffers(self, view_size):
          
          import math
          from pygame import Rect
  
          tw, th = self.data.tile_size
          mw, mh = self.data.map_size
          buffer_tile_width = int(math.ceil(view_size[0] / tw) + 2) * 2
          buffer_tile_height = int(math.ceil(view_size[1] / th) + 2) * 2
          buffer_pixel_size = buffer_tile_width * tw, buffer_tile_height * th
  
          self.map_rect = Rect(0, 0, mw * tw, mh * th)
          self.view_rect.size = view_size
          self._tile_view = Rect(0, 0, buffer_tile_width, buffer_tile_height)
          self._redraw_cutoff = 1  # TODO: optimize this value
          self._create_buffers(view_size, buffer_pixel_size)
          self._half_width = view_size[0] // 2
          self._half_height = view_size[1] // 2
          self._x_offset = 0
          self._y_offset = 0
  
          self.redraw_tiles()
docs: Create the buffers to cache tile drawing
  
          :param view_size: (int, int): size of the draw area
          :return: None