Changeset 405:a0aad1c66643


Ignore:
Timestamp:
04/09/11 15:09:42 (12 years ago)
Author:
Stefano Rivera <stefano@…>
Branch:
default
Phase:
public
Message:

Tail images

Files:
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • skaapsteker/constants.py

    r390 r405  
    3939
    4040    TAIL_START = 100
    41     TAIL_OFFSET = 30
     41    TAIL_OFFSET = 50
    4242    TAIL_POSITIONS = {
    4343            'shapeshift' : TAIL_START,
     
    5050            'lightning' : TAIL_START + 7 * TAIL_OFFSET,
    5151            }
    52     TAILS_WIDTH = 51
     52    TAILS_BG_MARGIN = 2
     53    TAILS_WIDTH = 42
    5354    TAILS_HEIGHT = 8 * TAIL_OFFSET
    5455
  • skaapsteker/levelscene.py

    r390 r405  
    4141        self._tofu = data.load_image('icons/tofu.png')
    4242        self._scroll = data.load_image('icons/haiku-scroll.png')
    43         self._tail = data.load_image('icons/tail.png')
    44 
     43        self._tails = {}
     44        for tail in constants.FoxHud.TAIL_POSITIONS.iterkeys():
     45            image = data.load_image('icons/tails/%s.png' % tail)
     46            grey_image = pygame.Surface(image.get_size())
     47            grey_image.convert_alpha(pygame.Surface((0, 0), 0, 8))
     48            grey_image.blit(image, (0, 0))
     49            self._tails[tail] = (grey_image, image)
    4550
    4651        for sprite in self._level.sprites:
     
    224229
    225230        # Tail bg
    226         bgsurf = pygame.Surface((self._tail.get_size()[0] + 2 * fox_hud.BG_MARGIN,
    227                                  fox_hud.TAILS_HEIGHT + fox_hud.BG_MARGIN),
     231        bgsurf = pygame.Surface((fox_hud.TAILS_WIDTH + 2 * fox_hud.TAILS_BG_MARGIN,
     232                                 fox_hud.TAILS_HEIGHT + 2 * fox_hud.TAILS_BG_MARGIN),
    228233                                flags=SRCALPHA)
    229234        bgsurf.fill((255, 255, 255, fox_hud.BG_ALPHA))
     
    232237                                  self._clip_rect.top
    233238                                  + fox_hud.TAIL_START
    234                                   - fox_hud.BG_MARGIN))
     239                                  - fox_hud.TAILS_BG_MARGIN))
    235240
    236241        # Draw tails
    237         # FIXME: Use correct tail icon
    238         for tail in fox.tails:
    239             tail_pos = self._clip_rect.left + 8, self._clip_rect.top + fox_hud.TAIL_POSITIONS[tail]
    240             self._level_surface.blit(self._tail, tail_pos)
     242        for tail, position in constants.FoxHud.TAIL_POSITIONS.iteritems():
     243            has_tail = tail in fox.tails
     244            tail_pos = (self._clip_rect.left + fox_hud.TAILS_BG_MARGIN,
     245                        self._clip_rect.top + fox_hud.TAIL_POSITIONS[tail])
     246            self._level_surface.blit(self._tails[tail][int(has_tail)], tail_pos)
    241247
    242248        # Draw the health bar
Note: See TracChangeset for help on using the changeset viewer.