title: Clickable images in pygame?
body: <pre><code>#Imported Pygame
  import pygame
  
  #The Colors
  BLACK = ( 0, 0, 0)
  GREEN = ( 0, 255, 0)
  WHITE = ( 255, 255, 255)
  RED = ( 255, 0, 0)
  ORANGE = ( 255, 115, 0)
  YELLOW = ( 242, 255, 0)
  BROWN = ( 115, 87, 39)
  PURPLE = ( 298, 0, 247)
  GRAY = ( 168, 168, 168)
  PINK = ( 255, 0, 234)
  pygame.init()
  #The Screen
  screen = pygame.display.set_mode([1000,500])
  #Name of the window
  pygame.display.set_caption("My first game")
  
  clock = pygame.time.Clock()
  
  #The sounds
  
  # Positions of graphics
  background_position = [0,0]
  singleplayer_position = [350,200]
  #The graphics
  background_image = pygame.image.load("Castle.png").convert()
  singleplayer_image = pygame.image.load("SinglePlayer.png").convert()
  singleplayer_image.set_colorkey(WHITE)
  #Main Loop __________________________
  
  done = False
  
  while not done:
      for event in pygame.event.get():
          if event.type == pygame.QUIT:
              done = True
      # Copy of background or main menu
      screen.blit(background_image, background_position)
  
      #Copy of other images
      screen.blit(singleplayer_image, singleplayer_position)
      pygame.display.flip()
      if pygame.mouse.get_pressed()[0] and singleplayer_image.collidepoint(mouse_pos):
         print("Hi") 
  
      clock.tick(60)
  #To quit game
  pygame.quit()
  </code></pre>
  
  <p>This is basicaly my code, but I keep getting the error that pygame.surface object has no attribute collide point. Im trying to have a clickable image,, but it isn't working to well. If you could show a way that a image can be clickable thank you.</p>