Mercurial > touhou
comparison pytouhou/game/player.py @ 184:54eb6b254b7b
When touched, drop the items at the right place, and add precisions about particles.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Wed, 26 Oct 2011 02:38:50 -0700 |
parents | 184196480f59 |
children | dbe6b7b2d3fc |
comparison
equal
deleted
inserted
replaced
183:b6d7ce644f34 | 184:54eb6b254b7b |
---|---|
125 | 125 |
126 if self.death_time: | 126 if self.death_time: |
127 time = self._game.frame - self.death_time | 127 time = self._game.frame - self.death_time |
128 if time == 6: # too late, you are dead :( | 128 if time == 6: # too late, you are dead :( |
129 self.state.touchable = False | 129 self.state.touchable = False |
130 self._game.drop_bonus(self.state.x, self.state.y, 2, end_pos=None) #TODO: find the formula | 130 self.state.lives -= 1 |
131 if self.state.power > 16: | |
132 self.state.power -= 16 | |
133 else: | |
134 self.state.power = 0 | |
135 | |
136 self._game.drop_bonus(self.state.x, self.state.y, 2, | |
137 end_pos=(self._game.prng.rand_double() * 288 + 48, # 102h.exe@0x41f3dc | |
138 self._game.prng.rand_double() * 192 - 64)) # @0x41f3 | |
131 for i in range(5): | 139 for i in range(5): |
132 self._game.drop_bonus(self.state.x, self.state.y, 0, end_pos=None) #TODO: find the formula | 140 self._game.drop_bonus(self.state.x, self.state.y, 0, |
133 self.state.lives -= 1 | 141 end_pos=(self._game.prng.rand_double() * 288 + 48, |
142 self._game.prng.rand_double() * 192 - 64)) | |
143 | |
134 for i in range(16): | 144 for i in range(16): |
135 self._game.new_particle((self.state.x, self.state.y), 0, 4., 256) | 145 self._game.new_particle((self.state.x, self.state.y), 0, 4., 256) #TODO: find the real size and range. |
136 | 146 |
137 elif time == 7: | 147 elif time == 7: |
138 self._sprite.mirrored = False | 148 self._sprite.mirrored = False |
139 self._sprite.fade(24, 128, lambda x: x) | 149 self._sprite.fade(24, 128, lambda x: x) |
140 self._sprite.blendfunc = 1 | 150 self._sprite.blendfunc = 1 |