Changeset 244:93a20b51963f for nagslang


Ignore:
Timestamp:
Sep 4, 2013, 8:26:15 PM (7 years ago)
Author:
David Sharpe
Branch:
default
Parents:
243:46707efbb3a5 (diff), 238:28d906fc2ab1 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • nagslang/screens/area.py

    r238 r244  
    177177            if overlay.is_visible():
    178178                overlay.render(surface, render_rect.topleft)
     179        self.render_health_bar(surface)
    179180
    180181    def tick_protagonist(self):
     
    186187        for drawable in self._drawables:
    187188            drawable.animate()
     189
    188190        super(AreaScreen, self).tick(seconds)
     191
     192    def render_health_bar(self, surface, health_as_percentage=50,
     193                         health_type='human'):
     194        rect = pygame.Rect(50, 500, 110, 50)
     195        pygame.draw.rect(surface,  pygame.color.THECOLORS['white'],
     196                         rect, 0)
     197        if health_type is 'human':
     198            health_colour = pygame.color.THECOLORS['red']
     199        else:
     200            health_colour = pygame.color.THECOLORS['purple']
     201        rect = pygame.Rect(55, 505, health_as_percentage, 40)
     202        pygame.draw.rect(surface,  health_colour,
     203                         rect, 0)
  • nagslang/screens/area.py

    r243 r244  
    127127            if ev.key == pygame.locals.K_c:
    128128                self.protagonist.toggle_form()
     129                self.world.transformations += 1
    129130        elif DoorEvent.matches(ev):
    130131            self.protagonist.set_position(ev.dest_pos)
     
    132133                # Go to anther screen
    133134                self._disable_render = True
     135                self.world.rooms += 1
    134136                ScreenChange.post(ev.destination, self.protagonist)
    135137                return
Note: See TracChangeset for help on using the changeset viewer.