Mercurial > touhou
comparison pytouhou/game/player.pyx @ 590:e15672733c93
Switch to Python 3.x instead of 2.7.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Tue, 30 Sep 2014 17:14:24 +0200 |
parents | e35a083d4208 |
children | 3c2f96f1d715 |
comparison
equal
deleted
inserted
replaced
589:0768122da817 | 590:e15672733c93 |
---|---|
81 if not self.invulnerable_time and not self.death_time and self.touchable: # Border Between Life and Death | 81 if not self.invulnerable_time and not self.death_time and self.touchable: # Border Between Life and Death |
82 self.death_time = self._game.frame | 82 self.death_time = self._game.frame |
83 self._game.new_effect((self.x, self.y), 17) | 83 self._game.new_effect((self.x, self.y), 17) |
84 self._game.modify_difficulty(-1600) | 84 self._game.modify_difficulty(-1600) |
85 self.play_sound('pldead00') | 85 self.play_sound('pldead00') |
86 for i in xrange(16): | 86 for i in range(16): |
87 self._game.new_particle((self.x, self.y), 11, 256) #TODO: find the real size and range. | 87 self._game.new_particle((self.x, self.y), 11, 256) #TODO: find the real size and range. |
88 | 88 |
89 | 89 |
90 def start_focusing(self): | 90 def start_focusing(self): |
91 self.focused = True | 91 self.focused = True |
203 if self.invulnerable_time > 0: | 203 if self.invulnerable_time > 0: |
204 self.invulnerable_time -= 1 | 204 self.invulnerable_time -= 1 |
205 | 205 |
206 m = self.invulnerable_time % 8 | 206 m = self.invulnerable_time % 8 |
207 if m == 7 or self.invulnerable_time == 0: | 207 if m == 7 or self.invulnerable_time == 0: |
208 for i in xrange(3): | 208 for i in range(3): |
209 self.sprite._color[i] = 255 | 209 self.sprite._color[i] = 255 |
210 self.sprite.changed = True | 210 self.sprite.changed = True |
211 elif m == 1: | 211 elif m == 1: |
212 for i in xrange(3): | 212 for i in range(3): |
213 self.sprite._color[i] = 64 | 213 self.sprite._color[i] = 64 |
214 self.sprite.changed = True | 214 self.sprite.changed = True |
215 | 215 |
216 if keystate & 1 and self.fire_time == 0: | 216 if keystate & 1 and self.fire_time == 0: |
217 self.fire_time = 30 | 217 self.fire_time = 30 |
253 # Don’t decrement if it’s infinite. | 253 # Don’t decrement if it’s infinite. |
254 if self.continues >= 0: | 254 if self.continues >= 0: |
255 self.continues -= 1 | 255 self.continues -= 1 |
256 self.continues_used += 1 | 256 self.continues_used += 1 |
257 | 257 |
258 for i in xrange(5): | 258 for i in range(5): |
259 self._game.drop_bonus(self.x, self.y, 4, player=self, | 259 self._game.drop_bonus(self.x, self.y, 4, player=self, |
260 end_pos=(self._game.prng.rand_double() * 288 + 48, | 260 end_pos=(self._game.prng.rand_double() * 288 + 48, |
261 self._game.prng.rand_double() * 192 - 64)) | 261 self._game.prng.rand_double() * 192 - 64)) |
262 self.score = self.continues_used if self.continues_used <= 9 else 9 | 262 self.score = self.continues_used if self.continues_used <= 9 else 9 |
263 self.effective_score = 0 | 263 self.effective_score = 0 |
269 self.points = 0 | 269 self.points = 0 |
270 else: | 270 else: |
271 self._game.drop_bonus(self.x, self.y, 2, player=self, | 271 self._game.drop_bonus(self.x, self.y, 2, player=self, |
272 end_pos=(self._game.prng.rand_double() * 288 + 48, # 102h.exe@0x41f3dc | 272 end_pos=(self._game.prng.rand_double() * 288 + 48, # 102h.exe@0x41f3dc |
273 self._game.prng.rand_double() * 192 - 64)) # @0x41f3 | 273 self._game.prng.rand_double() * 192 - 64)) # @0x41f3 |
274 for i in xrange(5): | 274 for i in range(5): |
275 self._game.drop_bonus(self.x, self.y, 0, player=self, | 275 self._game.drop_bonus(self.x, self.y, 0, player=self, |
276 end_pos=(self._game.prng.rand_double() * 288 + 48, | 276 end_pos=(self._game.prng.rand_double() * 288 + 48, |
277 self._game.prng.rand_double() * 192 - 64)) | 277 self._game.prng.rand_double() * 192 - 64)) |
278 | 278 |
279 elif time == 7: | 279 elif time == 7: |