comparison pytouhou/game/player.py @ 211:a765ef90c2b0

Make death animation closer to the original
author Thibaut Girka <thib@sitedethib.com>
date Fri, 25 Nov 2011 23:41:24 +0100
parents eca53abdfeab
children 0595315d3880
comparison
equal deleted inserted replaced
210:f5be441d2c42 211:a765ef90c2b0
177 end_pos=(self._game.prng.rand_double() * 288 + 48, 177 end_pos=(self._game.prng.rand_double() * 288 + 48,
178 self._game.prng.rand_double() * 192 - 64)) 178 self._game.prng.rand_double() * 192 - 64))
179 179
180 elif time == 7: 180 elif time == 7:
181 self._sprite.mirrored = False 181 self._sprite.mirrored = False
182 self._sprite.fade(24, 128, lambda x: x) 182 self._sprite.blendfunc = 0
183 self._sprite.blendfunc = 1 183 self._sprite.rescale = 0.75, 1.5
184 self._sprite.scale_in(24, 0., 2., lambda x: x) 184 self._sprite.fade(26, 96, lambda x: x)
185 185 self._sprite.scale_in(26, 0.00, 2.5, lambda x: x)
186 elif time == 31: 186
187 elif time == 32:
187 self.state.x = 192.0 188 self.state.x = 192.0
188 self.state.y = 384.0 189 self.state.y = 384.0
189 self.direction = None 190 self.direction = None
190 191
191 self._sprite = Sprite() 192 self._sprite = Sprite()
192 self._anmrunner = ANMRunner(self.anm_wrapper, 0, self._sprite) 193 self._anmrunner = ANMRunner(self.anm_wrapper, 0, self._sprite)
193 self._sprite.alpha = 128 194 self._sprite.alpha = 128
194 self._sprite.rescale = 0., 2. 195 self._sprite.rescale = 0.0, 2.5
195 self._sprite.fade(30, 255, lambda x: x) 196 self._sprite.fade(30, 255, lambda x: x)
196 self._sprite.blendfunc = 1 197 self._sprite.blendfunc = 1
197 self._sprite.scale_in(30, 1., 1., lambda x: x) 198 self._sprite.scale_in(30, 1., 1., lambda x: x)
198 self._anmrunner.run_frame() 199 self._anmrunner.run_frame()
199 200
200 elif time == 60: # respawned 201 elif time == 61: # respawned
201 self.state.touchable = True 202 self.state.touchable = True
202 self.state.invulnerable_time = 240 203 self.state.invulnerable_time = 240
203 self._sprite.blendfunc = 0 204 self._sprite.blendfunc = 0
205 self._sprite._changed = True
204 206
205 if time > 30: 207 if time > 30:
206 for bullet in self._game.bullets: 208 for bullet in self._game.bullets:
207 bullet.cancel() 209 bullet.cancel()
208 210