title: How is it possible to make multiple rectangle instances in Pygame?
body: <p>I'm trying to create multiple rectangles using a for loop with PyGame but I'm not really clear on how I could do this. My first approach was storing all rectangle instances in an array but then I ran into another problem, how to assign a <code>.get_rect()</code> to it. So I did this:</p>
  
  <pre><code>def MultiRect(amount):
      objects = []
      objectsRect = []
  
      for i in range(0, amount):
          objects.append(pygame.Surface([200,100]).convert())
          objects[i].fill((130,130,130))
          objectsRect.append(objects[i].get_rect())
  </code></pre>
  
  <p>So what I tried to do was make two arrays, one stores the instance and the other stores the <code>instance.get_rect()</code> but I know this is the wrong way to do it and I also get multiple <code>out of range</code> errors. Is there another way I could go about this? </p>