Mercurial > touhou
comparison pytouhou/game/sprite.py @ 21:bf225780973f
Small refactoring, and Rumia \o/
author | Thibaut Girka <thib@sitedethib.com> |
---|---|
date | Thu, 11 Aug 2011 12:39:12 +0200 |
parents | d940d004b840 |
children | f17122405121 |
comparison
equal
deleted
inserted
replaced
20:6ebf9539c077 | 21:bf225780973f |
---|---|
1 from struct import unpack | 1 from struct import unpack |
2 | 2 |
3 from pytouhou.utils.matrix import Matrix | 3 from pytouhou.utils.matrix import Matrix |
4 | |
5 | |
6 class AnmWrapper(object): | |
7 def __init__(self, anm_files): | |
8 self.anm_files = list(anm_files) | |
9 | |
10 def get_sprite(self, script_index): | |
11 for anm in self.anm_files: | |
12 if script_index in anm.scripts: | |
13 return anm, Sprite(anm, script_index) | |
14 | |
15 | |
4 | 16 |
5 class Sprite(object): | 17 class Sprite(object): |
6 def __init__(self, anm, script_index): | 18 def __init__(self, anm, script_index): |
7 self.anm = anm | 19 self.anm = anm |
8 self.script_index = script_index | 20 self.script_index = script_index |