comparison pytouhou/game/player.py @ 386:dc6ed7b1c6de

Cancel player lasers when she dies.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sat, 20 Oct 2012 20:44:12 +0200
parents 690b5faaa0e6
children ac2891afb0bb
comparison
equal deleted inserted replaced
385:d8aab27a2ab2 386:dc6ed7b1c6de
230 self.state.touchable = False 230 self.state.touchable = False
231 if self.state.power > 16: 231 if self.state.power > 16:
232 self.state.power -= 16 232 self.state.power -= 16
233 else: 233 else:
234 self.state.power = 0 234 self.state.power = 0
235 for laser in self._game.players_lasers:
236 if laser:
237 laser.cancel()
235 238
236 self.state.lives -= 1 239 self.state.lives -= 1
237 if self.state.lives < 0: 240 if self.state.lives < 0:
238 #TODO: display a menu to ask the players if they want to continue. 241 #TODO: display a menu to ask the players if they want to continue.
239 self._game.continues -= 1 242 self._game.continues -= 1