Mercurial > rinkhals
comparison gamelib/imagecache.py @ 53:f20dd3dcb118
foxes don't run backwards
author | Adrianna Pińska <adrianna.pinska@gmail.com> |
---|---|
date | Mon, 31 Aug 2009 17:47:10 +0000 |
parents | 6055a8a8678d |
children | 7bb8d9d6858a |
comparison
equal
deleted
inserted
replaced
52:0d4799866bcf | 53:f20dd3dcb118 |
---|---|
63 """Convert a day tile to a night tile.""" | 63 """Convert a day tile to a night tile.""" |
64 night_image = image.copy() | 64 night_image = image.copy() |
65 night_image.fill(NIGHT_COLOUR, None, BLEND_RGBA_MULT) | 65 night_image.fill(NIGHT_COLOUR, None, BLEND_RGBA_MULT) |
66 return night_image | 66 return night_image |
67 | 67 |
68 def convert_to_right_facing(image): | |
69 right_facing_image = image.copy() | |
70 right_facing_image = pygame.transform.flip(right_facing_image, 1, 0) | |
71 return right_facing_image | |
72 | |
68 # globals | 73 # globals |
69 | 74 |
70 cache = ImageCache() | 75 cache = ImageCache() |
71 cache.register_modifier("night", convert_to_night) | 76 cache.register_modifier("night", convert_to_night) |
77 cache.register_modifier("right_facing", convert_to_right_facing) | |
72 load_image = cache.load_image | 78 load_image = cache.load_image |