Changeset 8:addaa5b857d6


Ignore:
Timestamp:
Apr 3, 2011, 1:46:19 PM (9 years ago)
Author:
Jeremy Thurgood <firxen@…>
Branch:
default
rebase_source:
a144c89ec2c02af6beaabbba99b6999225b379c5
Message:

Some level display things.

Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • skaapsteker/__main__.py

    r7 r8  
    2525
    2626
     27def draw_level(leveldef, display):
     28    import level
     29    level.Level(leveldef).draw(display)
     30
     31
    2732def main():
    2833    """Launch Nine Tales.
     
    4752    pygame.display.set_caption("Nine Tales")
    4853
     54    draw_level('level1.json', display)
     55    pygame.display.flip()
     56
    4957    raw_input('?')
    5058
  • skaapsteker/data.py

    r0 r8  
    1111import os
    1212
     13import pygame.image
     14
     15
    1316data_py = os.path.abspath(os.path.dirname(__file__))
    1417data_dir = os.path.normpath(os.path.join(data_py, '..', 'data'))
     18
    1519
    1620def filepath(filename):
     
    1822    '''
    1923    return os.path.join(data_dir, filename)
     24
    2025
    2126def load(filename, mode='rb'):
     
    2631    return open(os.path.join(data_dir, filename), mode)
    2732
     33
     34IMAGES = {}
     35
     36def load_image(filename):
     37    if filename not in IMAGES:
     38        IMAGES[filename] = pygame.image.load(load(filename))
     39    return IMAGES[filename]
     40
Note: See TracChangeset for help on using the changeset viewer.