Ignore:
Timestamp:
Nov 21, 2009, 9:40:29 AM (11 years ago)
Author:
Neil Muller <drnlmuller@…>
Branch:
default
Convert:
svn:b4e93282-eac8-4b8b-b765-0f5d36de2b68/trunk/rinkhals@413
Message:

Levels can include starting equipment

File:
1 edited

Legend:

Unmodified
Added
Removed
  • regenerate_level_data.py

    r386 r408  
    66from pygame.locals import SWSURFACE, SRCALPHA
    77
    8 from gamelib import tiles, buildings
     8from gamelib import tiles, buildings, equipment
    99import regenerate_pngs
    1010
     
    4141def get_code_mappings():
    4242    code_map = {}
    43     # this list needs to manually kept in sync. This should be fixed
    44     for tn, sprite_name in [(1, 'chkn')]:
    45         image = generate_image(sprite_name, regenerate_pngs.SPRITE_PATH)
     43    # Needs better handling of wings
     44    for tn, sprites in equipment.EQUIP_MAP.iteritems():
     45        image = generate_image('chkn', regenerate_pngs.SPRITE_PATH)
     46        need_wing = False
     47        for equip in sprites:
     48            sub_image = generate_image(equip.CHICKEN_IMAGE_FILE,
     49                    regenerate_pngs.SPRITE_PATH)
     50            image.blit(sub_image, (0, 0))
     51            if equip.UNDER_LIMB:
     52                need_wing = True
     53        if need_wing:
     54            sub_image = generate_image('wing', regenerate_pngs.SPRITE_PATH)
     55            image.blit(sub_image, (0, 0))
    4656        if image:
    4757            code_map[tn] = image
Note: See TracChangeset for help on using the changeset viewer.