Changeset 261:86291107d67a


Ignore:
Timestamp:
Sep 5, 2009, 1:20:59 PM (11 years ago)
Author:
Jeremy Thurgood <firxen@…>
Branch:
default
Convert:
svn:b4e93282-eac8-4b8b-b765-0f5d36de2b68@262
Message:

Make regenerate_pngs more import-friendly.

File:
1 moved

Legend:

Unmodified
Added
Removed
  • regenerate_pngs.py

    r258 r261  
    5050    os.remove(png_name)
    5151
    52 if __name__ == "__main__":
    53     tile_path = "data/tiles"
    54     sprite_path = "data/sprites"
    55     image_path = "data/images"
    56     cursor_path = "data/cursors"
    57     sprites = [
    58         # chicken bits
    59         ("chkn", 20, 20),
    60         ("wing", 20, 20),
    61         ("eye", 20, 20),
    62         ("equip_rifle", 20, 20),
    63         ("equip_knife", 20, 20),
    64         ("equip_kevlar", 20, 20),
    65         ("equip_helmet", 20, 20),
    66         ("select_chkn", 20, 20),
    67         ("nest", 20, 20),
    68         ("equip_egg", 20, 20),
    69         # fox bits
    70         ("fox", 20, 20),
    71         ("ninja_fox", 20, 20),
    72         ("sapper_fox", 20, 20),
    73         ("rinkhals", 20, 20),
    74         # buildings
    75         ("henhouse", 60, 40),
    76         ("select_henhouse", 60, 40),
    77         ("hendominium", 40, 60),
    78         ("select_hendominium", 40, 60),
    79         ("watchtower", 40, 40),
    80         ("select_watchtower", 40, 40),
    81         # special effects
    82         ("muzzle_flash", 20, 20),
    83         ("chkn_death", 20, 20),
    84         ("fox_death", 20, 20),
    85         # other
    86         ("egg", 20, 20),
     52TILE_PATH = "data/tiles"
     53SPRITE_PATH = "data/sprites"
     54IMAGE_PATH = "data/images"
     55CURSOR_PATH = "data/cursors"
     56
     57SPRITES = [
     58    # chicken bits
     59    ("chkn", 20, 20),
     60    ("wing", 20, 20),
     61    ("eye", 20, 20),
     62    ("equip_rifle", 20, 20),
     63    ("equip_knife", 20, 20),
     64    ("equip_kevlar", 20, 20),
     65    ("equip_helmet", 20, 20),
     66    ("select_chkn", 20, 20),
     67    ("nest", 20, 20),
     68    ("equip_egg", 20, 20),
     69    # fox bits
     70    ("fox", 20, 20),
     71    ("ninja_fox", 20, 20),
     72    ("sapper_fox", 20, 20),
     73    ("rinkhals", 20, 20),
     74    # buildings
     75    ("henhouse", 60, 40),
     76    ("select_henhouse", 60, 40),
     77    ("hendominium", 40, 60),
     78    ("select_hendominium", 40, 60),
     79    ("watchtower", 40, 40),
     80    ("select_watchtower", 40, 40),
     81    # special effects
     82    ("muzzle_flash", 20, 20),
     83    ("chkn_death", 20, 20),
     84    ("fox_death", 20, 20),
     85    # other
     86    ("egg", 20, 20),
     87]
     88
     89CURSORS = [
     90    ("chkn", 16, 16),
     91    ("egg", 16, 16),
     92    ("sell_cursor", 24, 24),
    8793    ]
    8894
    89     cursors = [
    90         ("chkn", 16, 16),
    91         ("egg", 16, 16),
    92         ("sell_cursor", 24, 24),
    93         ]
    94 
     95if __name__ == "__main__":
    9596    process_svg_folder("data/tiles", 20, 20)
    9697    process_svg_folder("data/icons", 40, 40)
    97     for name, width, height in sprites:
    98         process_sprite(name, width, height, sprite_path)
    99     process_sprite("splash", 800, 600, image_path)
    100     process_sprite("gameover_win", 800, 600, image_path)
    101     process_sprite("gameover_lose", 800, 600, image_path)
    102     for name, width, height in cursors:
    103         process_cursor(name, width, height, sprite_path, cursor_path)
     98    for name, width, height in SPRITES:
     99        process_sprite(name, width, height, SPRITE_PATH)
     100    process_sprite("splash", 800, 600, IMAGE_PATH)
     101    process_sprite("gameover_win", 800, 600, IMAGE_PATH)
     102    process_sprite("gameover_lose", 800, 600, IMAGE_PATH)
     103    for name, width, height in CURSORS:
     104        process_cursor(name, width, height, SPRITE_PATH, CURSOR_PATH)
Note: See TracChangeset for help on using the changeset viewer.