Mercurial > touhou
comparison pytouhou/game/player.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 | b9d2db93972f |
comparison
equal
deleted
inserted
replaced
432:d4874ebaa06e | 433:1222341ea22c |
---|---|
85 | 85 |
86 | 86 |
87 def set_anim(self, index): | 87 def set_anim(self, index): |
88 self.sprite = Sprite() | 88 self.sprite = Sprite() |
89 self.anmrunner = ANMRunner(self.anm, index, self.sprite) | 89 self.anmrunner = ANMRunner(self.anm, index, self.sprite) |
90 self.anmrunner.run_frame() | |
91 | 90 |
92 | 91 |
93 def play_sound(self, name): | 92 def play_sound(self, name): |
94 self._game.sfx_player.play('%s.wav' % name) | 93 self._game.sfx_player.play('%s.wav' % name) |
95 | 94 |
278 self.sprite.alpha = 128 | 277 self.sprite.alpha = 128 |
279 self.sprite.rescale = 0.0, 2.5 | 278 self.sprite.rescale = 0.0, 2.5 |
280 self.sprite.fade(30, 255, lambda x: x) | 279 self.sprite.fade(30, 255, lambda x: x) |
281 self.sprite.blendfunc = 1 | 280 self.sprite.blendfunc = 1 |
282 self.sprite.scale_in(30, 1., 1., lambda x: x) | 281 self.sprite.scale_in(30, 1., 1., lambda x: x) |
283 self.anmrunner.run_frame() | |
284 | 282 |
285 elif time == 61: # respawned | 283 elif time == 61: # respawned |
286 self.state.touchable = True | 284 self.state.touchable = True |
287 self.state.invulnerable_time = 240 | 285 self.state.invulnerable_time = 240 |
288 self.sprite.blendfunc = 0 | 286 self.sprite.blendfunc = 0 |