Mercurial > touhou
comparison pytouhou/games/eosd.py @ 387:e1f5dcd4b83e
Display something at the start of a stage.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Sat, 20 Oct 2012 20:48:40 +0200 |
parents | 690b5faaa0e6 |
children | b11953cf1d3b |
comparison
equal
deleted
inserted
replaced
386:dc6ed7b1c6de | 387:e1f5dcd4b83e |
---|---|
89 (0, 2, 4, 8, 10, 11, 12)) | 89 (0, 2, 4, 8, 10, 11, 12)) |
90 | 90 |
91 characters = resource_loader.get_eosd_characters() | 91 characters = resource_loader.get_eosd_characters() |
92 players = [EoSDPlayer(state, self, resource_loader, characters[state.character]) for state in player_states] | 92 players = [EoSDPlayer(state, self, resource_loader, characters[state.character]) for state in player_states] |
93 | 93 |
94 self.stage = stage #XXX | |
94 interface = EoSDInterface(self, resource_loader) | 95 interface = EoSDInterface(self, resource_loader) |
95 | 96 |
96 Game.__init__(self, resource_loader, players, stage, rank, difficulty, | 97 Game.__init__(self, resource_loader, players, stage, rank, difficulty, |
97 bullet_types, laser_types, item_types, nb_bullets_max, | 98 bullet_types, laser_types, item_types, nb_bullets_max, |
98 width, height, prng, interface, continues) | 99 width, height, prng, interface, continues) |
116 [Effect((32 + 32 * i, 464), 8, front) for i in range(12)] + | 117 [Effect((32 + 32 * i, 464), 8, front) for i in range(12)] + |
117 [Effect((0, 0), 5, front)] + | 118 [Effect((0, 0), 5, front)] + |
118 [Effect((0, 0), i, front) for i in range(5) + range(9, 16)]) | 119 [Effect((0, 0), i, front) for i in range(5) + range(9, 16)]) |
119 for item in self.items: | 120 for item in self.items: |
120 item.sprite.allow_dest_offset = True #XXX | 121 item.sprite.allow_dest_offset = True #XXX |
122 | |
123 self.level_start = [Text((176, 200), ascii_wrapper, text='STAGE %d' % game.stage)] #TODO: find the exact location. | |
124 self.level_start[0].set_timeout(240, effect=60, start=120) | |
125 self.level_start[0].set_color('yellow') | |
126 #TODO: use the system text for the stage name, and the song name. | |
121 | 127 |
122 self.labels = { | 128 self.labels = { |
123 'highscore': Text((500, 58), ascii_wrapper, front, text='0'), | 129 'highscore': Text((500, 58), ascii_wrapper, front, text='0'), |
124 'score': Text((500, 82), ascii_wrapper, front, text='0'), | 130 'score': Text((500, 82), ascii_wrapper, front, text='0'), |
125 'player': Counter((500, 122), front, front, script=16, value=0), | 131 'player': Counter((500, 122), front, front, script=16, value=0), |
157 | 163 |
158 | 164 |
159 def update(self): | 165 def update(self): |
160 for elem in self.items: | 166 for elem in self.items: |
161 elem.update() | 167 elem.update() |
168 | |
169 for elem in self.level_start: | |
170 elem.update() | |
171 if elem.removed: #XXX | |
172 self.level_start = [] | |
162 | 173 |
163 player_state = self.game.players[0].state | 174 player_state = self.game.players[0].state |
164 | 175 |
165 self.highscore = max(self.highscore, player_state.effective_score) | 176 self.highscore = max(self.highscore, player_state.effective_score) |
166 self.labels['highscore'].set_text('%09d' % self.highscore) | 177 self.labels['highscore'].set_text('%09d' % self.highscore) |