Mercurial > skaapsteker
diff skaapsteker/levelscene.py @ 430:25efc74ac19c
Hook up flight and invisibility discharge
author | Stefano Rivera <stefano@rivera.za.net> |
---|---|
date | Sat, 09 Apr 2011 18:40:25 +0200 |
parents | 845e8e94219f |
children | 4240854e59b0 |
line wrap: on
line diff
--- a/skaapsteker/levelscene.py Sat Apr 09 18:23:59 2011 +0200 +++ b/skaapsteker/levelscene.py Sat Apr 09 18:40:25 2011 +0200 @@ -241,17 +241,22 @@ # Draw tails for tail, position in constants.FoxHud.TAIL_POSITIONS.iteritems(): has_tail = tail in fox.tails - tail_pos = (self._clip_rect.left + fox_hud.TAILS_BG_MARGIN, - self._clip_rect.top + fox_hud.TAIL_POSITIONS[tail]) + tail_pos = pygame.Rect(self._clip_rect.left + fox_hud.TAILS_BG_MARGIN, + self._clip_rect.top + fox_hud.TAIL_POSITIONS[tail], + 0, 0) - if has_tail and tail in ('fireball', 'lightning'): - imgs = self._tails[tail] - size = imgs[0].get_size() + imgs = self._tails[tail] + size = imgs[0].get_size() + if has_tail and tail in ('flight', 'invisibility'): + area = pygame.Rect(self._player.discharge_level(tail) * size[0], 0, size[0], size[1]) + self._level_surface.blit(imgs[0], tail_pos) + self._level_surface.blit(imgs[1], tail_pos.move(area.left, 0), area) + elif has_tail and tail in ('fireball', 'lightning', 'shield'): area = pygame.Rect(0, 0, self._player.recharge_level(tail) * size[0], size[1]) self._level_surface.blit(imgs[0], tail_pos) self._level_surface.blit(imgs[1], tail_pos, area) else: - self._level_surface.blit(self._tails[tail][int(has_tail)], tail_pos) + self._level_surface.blit(imgs[int(has_tail)], tail_pos) # Draw the health bar health_bottom = self._clip_rect.right - 30, self._clip_rect.top + 200