comparison pytouhou/game/player.py @ 190:dbe6b7b2d3fc

Fix a few things about particles.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Thu, 27 Oct 2011 15:09:42 -0700
parents 54eb6b254b7b
children d2b58a26c908
comparison
equal deleted inserted replaced
189:ba3297ab3bde 190:dbe6b7b2d3fc
76 76
77 def collide(self): 77 def collide(self):
78 if not self.state.invulnerable_time and not self.death_time and self.state.touchable: # Border Between Life and Death 78 if not self.state.invulnerable_time and not self.death_time and self.state.touchable: # Border Between Life and Death
79 self.death_time = self._game.frame 79 self.death_time = self._game.frame
80 self._game.new_death((self.state.x, self.state.y), 2) 80 self._game.new_death((self.state.x, self.state.y), 2)
81 for i in range(16):
82 self._game.new_particle((self.state.x, self.state.y), 2, 4., 256, delay=True) #TODO: find the real size and range.
81 83
82 84
83 def collect(self, item): 85 def collect(self, item):
84 #TODO 86 #TODO
85 self.state.score += item._item_type.score 87 self.state.score += item._item_type.score
139 for i in range(5): 141 for i in range(5):
140 self._game.drop_bonus(self.state.x, self.state.y, 0, 142 self._game.drop_bonus(self.state.x, self.state.y, 0,
141 end_pos=(self._game.prng.rand_double() * 288 + 48, 143 end_pos=(self._game.prng.rand_double() * 288 + 48,
142 self._game.prng.rand_double() * 192 - 64)) 144 self._game.prng.rand_double() * 192 - 64))
143 145
144 for i in range(16):
145 self._game.new_particle((self.state.x, self.state.y), 0, 4., 256) #TODO: find the real size and range.
146
147 elif time == 7: 146 elif time == 7:
148 self._sprite.mirrored = False 147 self._sprite.mirrored = False
149 self._sprite.fade(24, 128, lambda x: x) 148 self._sprite.fade(24, 128, lambda x: x)
150 self._sprite.blendfunc = 1 149 self._sprite.blendfunc = 1
151 self._sprite.scale_in(24, 0., 2., lambda x: x) 150 self._sprite.scale_in(24, 0., 2., lambda x: x)