Ignore:
Timestamp:
Sep 4, 2013, 8:46:29 PM (7 years ago)
Author:
David Sharpe
Branch:
default
Message:

Added health to protagonist.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nagslang/screens/area.py

    r244 r246  
    190190        super(AreaScreen, self).tick(seconds)
    191191
    192     def render_health_bar(self, surface, health_as_percentage=50,
    193                          health_type='human'):
     192    def render_health_bar(self, surface):
    194193        rect = pygame.Rect(50, 500, 110, 50)
    195194        pygame.draw.rect(surface,  pygame.color.THECOLORS['white'],
    196195                         rect, 0)
    197         if health_type is 'human':
     196        if self.protagonist.in_human_form():
    198197            health_colour = pygame.color.THECOLORS['red']
    199198        else:
    200199            health_colour = pygame.color.THECOLORS['purple']
    201         rect = pygame.Rect(55, 505, health_as_percentage, 40)
     200        rect = pygame.Rect(55, 505, self.protagonist.get_health_level(), 40)
    202201        pygame.draw.rect(surface,  health_colour,
    203202                         rect, 0)
     203       
Note: See TracChangeset for help on using the changeset viewer.