Mercurial > touhou
comparison pytouhou/game/sprite.py @ 58:3da4de9decd0
Use logging module
author | Thibaut Girka <thib@sitedethib.com> |
---|---|
date | Tue, 23 Aug 2011 21:01:50 +0200 |
parents | 694f25881d0f |
children | 0886994029e4 |
comparison
equal
deleted
inserted
replaced
57:694f25881d0f | 58:3da4de9decd0 |
---|---|
15 | 15 |
16 from random import randrange | 16 from random import randrange |
17 from struct import unpack | 17 from struct import unpack |
18 | 18 |
19 from pytouhou.utils.matrix import Matrix | 19 from pytouhou.utils.matrix import Matrix |
20 from pytouhou.utils.helpers import get_logger | |
21 | |
22 logger = get_logger(__name__) | |
20 | 23 |
21 | 24 |
22 class AnmWrapper(object): | 25 class AnmWrapper(object): |
23 def __init__(self, anm_files): | 26 def __init__(self, anm_files): |
24 self.anm_files = list(anm_files) | 27 self.anm_files = list(anm_files) |
152 self.texoffsets = tox, toy + args[0] | 155 self.texoffsets = tox, toy + args[0] |
153 elif instr_type in (15, 21): | 156 elif instr_type in (15, 21): |
154 self.keep_still = True | 157 self.keep_still = True |
155 break | 158 break |
156 else: | 159 else: |
157 print('unhandled opcode: %d, %r' % (instr_type, args)) #TODO | 160 logger.warn('unhandled instruction %d (args: %r)', instr_type, args) |
158 self.frame += 1 | 161 self.frame += 1 |
159 | 162 |
160 ax, ay, az = self.rotations_3d | 163 ax, ay, az = self.rotations_3d |
161 sax, say, saz = self.rotations_speed_3d | 164 sax, say, saz = self.rotations_speed_3d |
162 self.rotations_3d = ax + sax, ay + say, az + saz | 165 self.rotations_3d = ax + sax, ay + say, az + saz |