Mercurial > nagslang
diff nagslang/screens/area.py @ 246:281c54cefe08
Added health to protagonist.
author | David Sharpe |
---|---|
date | Wed, 04 Sep 2013 22:46:29 +0200 |
parents | 93a20b51963f |
children | 70d696b82399 |
line wrap: on
line diff
--- a/nagslang/screens/area.py Wed Sep 04 22:26:36 2013 +0200 +++ b/nagslang/screens/area.py Wed Sep 04 22:46:29 2013 +0200 @@ -189,15 +189,15 @@ super(AreaScreen, self).tick(seconds) - def render_health_bar(self, surface, health_as_percentage=50, - health_type='human'): + def render_health_bar(self, surface): rect = pygame.Rect(50, 500, 110, 50) pygame.draw.rect(surface, pygame.color.THECOLORS['white'], rect, 0) - if health_type is 'human': + if self.protagonist.in_human_form(): health_colour = pygame.color.THECOLORS['red'] else: health_colour = pygame.color.THECOLORS['purple'] - rect = pygame.Rect(55, 505, health_as_percentage, 40) + rect = pygame.Rect(55, 505, self.protagonist.get_health_level(), 40) pygame.draw.rect(surface, health_colour, - rect, 0) \ No newline at end of file + rect, 0) + \ No newline at end of file