title: Scaling a sprite in main loop
body: <p>I want to create a game where circles are generated randomly over the surface and start to grow. When 2 circles touch each other the game ends. So, everything is working except the resizing of the sprite during a loop. When I use <code>transform.scale</code> I get something like this:</p>
  <p><img src="https://i.stack.imgur.com/Hs2Qj.png" alt="Resizing using &quot;transform.scale" /></p>
  <p>Then I found <code>transform.smoothscale</code> in the doc. I used changed my code to use this and then it looked like this:</p>
  <p><img src="https://i.stack.imgur.com/o9dgh.png" alt="Resizing using &quot;transform.smoothscale&quot;" /></p>
  <p>I also tried to use <code>Rect.inflate</code> but this did nothing to my sprite. And I tried <code>Rect.infalte_ip</code> and if I use this, the sprite won't grow it is more likely to move out of the frame. Any ideas on how I can make these Sprite grow in place and that they resize how they should?</p>
  <pre><code>class Bubbles(pygame.sprite.Sprite):
  def __init__(self):
      super().__init__()
      self.image_scale = 100
      self.image_scale_factor = 1
      self.image = resources.BUBBLE_SKIN[0].convert_alpha()
      self.image = pygame.transform.scale(self.image, (self.image_scale, self.image_scale))
      self.rect = self.image.get_rect()
      self.rect.centerx = (random.randrange(Settings.object_range_limit + (self.image_scale//2), (Settings.width - Settings.object_range_limit - self.image_scale)))
      self.rect.centery = (random.randrange(Settings.object_range_limit + (self.image_scale//2), (Settings.height - Settings.object_range_limit - self.image_scale)))
  
      self.growth_rate = random.randint(1, 4)
  
  def update(self):
      self.image_scale += self.growth_rate
      self.image = pygame.transform.scale(self.image, (self.image_scale, self.image_scale))
  </code></pre>