comparison pytouhou/game/player.pyx @ 471:06f0eeb519bb

Make Laser and Orb extension types, and use that where possible.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Mon, 16 Sep 2013 18:42:04 +0200
parents feecdb4a8928
children 8038f1957b71
comparison
equal deleted inserted replaced
470:98995d8ac744 471:06f0eeb519bb
17 from pytouhou.game.sprite cimport Sprite 17 from pytouhou.game.sprite cimport Sprite
18 from pytouhou.vm.anmrunner import ANMRunner 18 from pytouhou.vm.anmrunner import ANMRunner
19 from pytouhou.game.bullettype import BulletType 19 from pytouhou.game.bullettype import BulletType
20 from pytouhou.game.bullet cimport Bullet 20 from pytouhou.game.bullet cimport Bullet
21 from pytouhou.game.lasertype import LaserType 21 from pytouhou.game.lasertype import LaserType
22 from pytouhou.game.laser import PlayerLaser 22 from pytouhou.game.laser cimport PlayerLaser
23 23
24 24
25 class GameOver(Exception): 25 class GameOver(Exception):
26 pass 26 pass
27 27
245 self.state.touchable = False 245 self.state.touchable = False
246 if self.state.power > 16: 246 if self.state.power > 16:
247 self.state.power -= 16 247 self.state.power -= 16
248 else: 248 else:
249 self.state.power = 0 249 self.state.power = 0
250 for laser in self._game.players_lasers: 250 self._game.cancel_player_lasers()
251 if laser is not None:
252 laser.cancel()
253 251
254 self.state.miss += 1 252 self.state.miss += 1
255 self.state.lives -= 1 253 self.state.lives -= 1
256 if self.state.lives < 0: 254 if self.state.lives < 0:
257 #TODO: display a menu to ask the players if they want to continue. 255 #TODO: display a menu to ask the players if they want to continue.