comparison pytouhou/game/player.py @ 175:5dc243bcf312

Don’t collect the items you drop while dying…
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Fri, 21 Oct 2011 10:45:07 -0700
parents 35d850502d1f
children 80a4c7ed43b3
comparison
equal deleted inserted replaced
174:c0183515a0a3 175:5dc243bcf312
123 self._sprite._changed = True 123 self._sprite._changed = True
124 124
125 if self.death_time: 125 if self.death_time:
126 time = self._game.frame - self.death_time 126 time = self._game.frame - self.death_time
127 if time == 6: # too late, you are dead :( 127 if time == 6: # too late, you are dead :(
128 self.state.touchable = False
128 self._game.drop_bonus(self.state.x, self.state.y, 2, end_pos=None) #TODO: find the formula 129 self._game.drop_bonus(self.state.x, self.state.y, 2, end_pos=None) #TODO: find the formula
129 for i in range(5): 130 for i in range(5):
130 self._game.drop_bonus(self.state.x, self.state.y, 0, end_pos=None) #TODO: find the formula 131 self._game.drop_bonus(self.state.x, self.state.y, 0, end_pos=None) #TODO: find the formula
131 self.state.lives -= 1 132 self.state.lives -= 1
132 133
133 elif time == 7: 134 elif time == 7:
134 self.state.touchable = False
135 self._sprite.mirrored = False 135 self._sprite.mirrored = False
136 self._sprite.fade(24, 128, lambda x: x) 136 self._sprite.fade(24, 128, lambda x: x)
137 self._sprite.blendfunc = 1 137 self._sprite.blendfunc = 1
138 self._sprite.scale_in(24, 0., 2., lambda x: x) 138 self._sprite.scale_in(24, 0., 2., lambda x: x)
139 139