title: how to detect if the sprite has been clicked in pygame
body: <p>Im new in pygame, right now im working with sprites. My question is how do i detect if the sprite has been clicked? I want to do something when the sprite was clicked just like a button.</p>
  
  <p>thx :)</p>
  
  <p>[Edited]</p>
  
  <p>thx Stephen. In addition is there a way to know who is the sprite that was clicked? Here is sample code </p>
  
  <pre><code>boxes = pygame.sprite.Group()
  for color, location in [([255, 0, 0], [0, 0]),
                          ([0, 255, 0], [60, 60]),
                          ([0, 0, 255], [120, 120])]:
      boxes.add(UpDownBox(color, location)
  </code></pre>
  
  <p>for example i click the sprite in location [0,0], the program should print its color or its location. thanks again :)</p>