title: How to close an image with a button - Python
body: <p>G'day everyone, I am new at coding and I wanted to ask how to close an image with a button,
  I tried to do that with the knowledge I have, but it didn't work. Here's the code, Thanks.</p>
  <pre><code>while running:
  
      
      if image_button.draw():
          screen.blit(image, [771, 198])
          if close_button.draw():
              image = False
              close_button = False
              pygame.display.flip()
  
  
      for event in pygame.event.get():
          if event.type == pygame.QUIT:
              running = False
  
  
      pygame.display.flip()
      pygame.display.update()
  </code></pre>