title: button class error:'button_list not defined'… using replit
body: <p>I am following a tutorial online creating a map editor for a platform game and my import button feature is not working, showing error 'button_list not defined' but I can not see why this is as I defined it as empty list already. It runs the code until I put the draw method in at the bottom, then it throws this error...</p>
  <pre><code>import pygame
  import button
  
  def button():
      button_list = []
      button_col = 0
      button_row = 0
      for i in range(len(img_list)):
          tile_button = button.Button(SCREEN_WIDTH + (75 * button_col) + 50, 75 * button_row + 50, img_list[i], 1)
          button_list.append(tile_button)
          button_col += 1
          if button_col == 3:
              button_row += 1
              button_col = 0
  
  for i in button_list:
      i.draw(screen)
  </code></pre>