comparison pytouhou/game/game.pyx @ 574:94229756abd9

Give extra lives to the player once she has reached a certain score, and increment the default score on continue.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sat, 26 Jul 2014 13:07:26 +0200
parents e35bef07290d
children e15672733c93
comparison
equal deleted inserted replaced
573:4233c1c01d90 574:94229756abd9
358 bullet.update() 358 bullet.update()
359 359
360 for player, keystate in zip(self.players, keystates): 360 for player, keystate in zip(self.players, keystates):
361 player.update(keystate) #TODO: differentiate keystates (multiplayer mode) 361 player.update(keystate) #TODO: differentiate keystates (multiplayer mode)
362 362
363 old_effective_score = player.effective_score
363 #XXX: Why 78910? Is it really the right value? 364 #XXX: Why 78910? Is it really the right value?
364 player.effective_score = min(player.effective_score + 78910, 365 player.effective_score = min(old_effective_score + 78910,
365 player.score) 366 player.score)
366 #TODO: give extra lives to the player 367 if self.stage < 7:
368 for i in [10000000, 20000000, 40000000, 60000000]:
369 if player.effective_score >= i and old_effective_score < i:
370 if player.lives < 8:
371 player.lives += 1
372 self.modify_difficulty(+2)
373 player.play_sound('extend')
367 374
368 375
369 cdef void update_effects(self): 376 cdef void update_effects(self):
370 cdef Element effect 377 cdef Element effect
371 378