def decrease_lives(self): self.lives -= 1 if self.lives <= 0: raise exceptions.GameOver('Player died', score=self.score, name=self.name) return self.lives
def decrease_lives(self): """ If player lost battle then reduce his lives :return: int Player's lives """ # Raises a GameOver exception self.lives -= 1 if self.lives == 0: print('Your Game is Over') print('Your total score is ', self.score) exceptions.GameOver.save_result(self.name, self.score) raise exceptions.GameOver() return self.lives
def exit_func(self): raise exceptions.GameOver('You stopped the game', score=self.score, name=self.name)
def out(): """ close game """ raise exceptions.GameOver("", 0)
def decrease_lives(self): self.lives -= 1 if (self.lives == 0): raise exceptions.GameOver()
def decrease_lives(self): """ player's decrease lives """ if self.lives == 0: raise exceptions.GameOver(self.name, self.score) else: self.lives -= 1