Mercurial > touhou
diff 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 |
line wrap: on
line diff
--- a/pytouhou/games/eosd.py +++ b/pytouhou/games/eosd.py @@ -91,6 +91,7 @@ class EoSDGame(Game): characters = resource_loader.get_eosd_characters() players = [EoSDPlayer(state, self, resource_loader, characters[state.character]) for state in player_states] + self.stage = stage #XXX interface = EoSDInterface(self, resource_loader) Game.__init__(self, resource_loader, players, stage, rank, difficulty, @@ -119,6 +120,11 @@ class EoSDInterface(object): for item in self.items: item.sprite.allow_dest_offset = True #XXX + self.level_start = [Text((176, 200), ascii_wrapper, text='STAGE %d' % game.stage)] #TODO: find the exact location. + self.level_start[0].set_timeout(240, effect=60, start=120) + self.level_start[0].set_color('yellow') + #TODO: use the system text for the stage name, and the song name. + self.labels = { 'highscore': Text((500, 58), ascii_wrapper, front, text='0'), 'score': Text((500, 82), ascii_wrapper, front, text='0'), @@ -160,6 +166,11 @@ class EoSDInterface(object): for elem in self.items: elem.update() + for elem in self.level_start: + elem.update() + if elem.removed: #XXX + self.level_start = [] + player_state = self.game.players[0].state self.highscore = max(self.highscore, player_state.effective_score)