comparison pytouhou/game/game.py @ 339:7a05edbab88a

Implement continues when the lives fall bellow 0.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Wed, 04 Jul 2012 21:38:00 +0200
parents 72ef7e24b373
children 61caded6b4f5
comparison
equal deleted inserted replaced
338:65453340ae95 339:7a05edbab88a
26 from pytouhou.game.effect import Particle 26 from pytouhou.game.effect import Particle
27 from pytouhou.game.text import Text 27 from pytouhou.game.text import Text
28 28
29 29
30 30
31 class GameOver(Exception):
32 pass
33
34
31 class Game(object): 35 class Game(object):
32 def __init__(self, resource_loader, players, stage, rank, difficulty, 36 def __init__(self, resource_loader, players, stage, rank, difficulty,
33 bullet_types, laser_types, item_types, 37 bullet_types, laser_types, item_types,
34 nb_bullets_max=None, width=384, height=448, prng=None, interface=None): 38 nb_bullets_max=None, width=384, height=448, prng=None,
39 interface=None, continues=0):
35 self.resource_loader = resource_loader 40 self.resource_loader = resource_loader
36 41
37 self.width, self.height = width, height 42 self.width, self.height = width, height
38 43
39 self.nb_bullets_max = nb_bullets_max 44 self.nb_bullets_max = nb_bullets_max
51 self.players_lasers = [None, None] 56 self.players_lasers = [None, None]
52 self.items = [] 57 self.items = []
53 self.labels = [] 58 self.labels = []
54 self.interface = interface 59 self.interface = interface
55 60
61 self.continues = continues
56 self.stage = stage 62 self.stage = stage
57 self.rank = rank 63 self.rank = rank
58 self.difficulty = difficulty 64 self.difficulty = difficulty
59 self.difficulty_counter = 0 65 self.difficulty_counter = 0
60 self.difficulty_min = 12 if rank == 0 else 10 66 self.difficulty_min = 12 if rank == 0 else 10