title: Pygame Scaling Healthbar
body: <p>I'm working on an RPG like game, where your maximum health can be increased throughout.</p>
  
  <p>I am trying to make a script that will draw a health bar, 100 Pixels Wide, for values over 100.</p>
  
  <p>As your health goes up, the units of the health bar get smaller.</p>
  
  <p>This was the best I could think of:</p>
  
  <pre><code>#Draw Bar
  import pygame
  
  def SingleColorBar(surface,color,x,y,value,maxvalue):
      xx=0
      for hp in range(value):
          pygame.draw.rect(surface, color, (x+xx,y,1,32), 0)
          xx+= value/100
  </code></pre>
  
  <p>This did not work at all as intended!</p>