Mercurial > touhou
comparison pytouhou/game/enemy.py @ 433:1222341ea22c
Always run the first frame of an ANMRunner.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Sun, 11 Aug 2013 14:23:50 +0200 |
parents | c9433188ffdb |
children | d778db08190f |
comparison
equal
deleted
inserted
replaced
432:d4874ebaa06e | 433:1222341ea22c |
---|---|
222 | 222 |
223 def set_anim(self, index): | 223 def set_anim(self, index): |
224 entry = 0 if index in self._anms[0].scripts else 1 | 224 entry = 0 if index in self._anms[0].scripts else 1 |
225 self.sprite = Sprite() | 225 self.sprite = Sprite() |
226 self.anmrunner = ANMRunner(self._anms[entry], index, self.sprite) | 226 self.anmrunner = ANMRunner(self._anms[entry], index, self.sprite) |
227 self.anmrunner.run_frame() | |
228 | 227 |
229 | 228 |
230 def die_anim(self): | 229 def die_anim(self): |
231 anim = {0: 3, 1: 4, 2: 5}[self.death_anim % 256] # The TB is wanted, if index isn’t in these values the original game crashs. | 230 anim = {0: 3, 1: 4, 2: 5}[self.death_anim % 256] # The TB is wanted, if index isn’t in these values the original game crashs. |
232 self._game.new_effect((self.x, self.y), anim) | 231 self._game.new_effect((self.x, self.y), anim) |