comparison pytouhou/game/enemy.py @ 319:9a4119e2cc74

Use Enemy.die_score.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Thu, 17 May 2012 14:19:00 +0200
parents 1366cefd0334
children 1a4ffdda8735
comparison
equal deleted inserted replaced
318:1366cefd0334 319:9a4119e2cc74
33 self.anmrunner = None 33 self.anmrunner = None
34 self.removed = False 34 self.removed = False
35 self.visible = True 35 self.visible = True
36 self.was_visible = False 36 self.was_visible = False
37 self.bonus_dropped = bonus_dropped 37 self.bonus_dropped = bonus_dropped
38 self.die_score = die_score #TODO: use it 38 self.die_score = die_score
39 39
40 self.frame = 0 40 self.frame = 0
41 41
42 self.x, self.y, self.z = pos 42 self.x, self.y, self.z = pos
43 self.life = 1 if life < 0 else life 43 self.life = 1 if life < 0 else life
345 if self.life <= 0 and self.touchable: 345 if self.life <= 0 and self.touchable:
346 death_flags = self.death_flags & 7 346 death_flags = self.death_flags & 7
347 347
348 self.die_anim() 348 self.die_anim()
349 349
350 #TODO: verify if the score is added with all the different flags.
351 self._game.players[0].state.score += self.die_score #TODO: better distribution amongst the players.
352
350 if death_flags < 4: 353 if death_flags < 4:
351 if self.bonus_dropped > -1: 354 if self.bonus_dropped > -1:
352 self.drop_particles(7, 0) 355 self.drop_particles(7, 0)
353 self._game.drop_bonus(self.x, self.y, self.bonus_dropped) 356 self._game.drop_bonus(self.x, self.y, self.bonus_dropped)
354 elif self.bonus_dropped == -1: 357 elif self.bonus_dropped == -1: