comparison pytouhou/games/eosd.py @ 323:2fcdb8966957

Display lives and bombs.
author Thibaut Girka <thib@sitedethib.com>
date Wed, 13 Jun 2012 22:53:57 +0200
parents 4e8192aadcaa
children 7a05edbab88a
comparison
equal deleted inserted replaced
322:4e8192aadcaa 323:2fcdb8966957
19 from pytouhou.game.lasertype import LaserType 19 from pytouhou.game.lasertype import LaserType
20 from pytouhou.game.itemtype import ItemType 20 from pytouhou.game.itemtype import ItemType
21 from pytouhou.game.player import Player 21 from pytouhou.game.player import Player
22 from pytouhou.game.orb import Orb 22 from pytouhou.game.orb import Orb
23 from pytouhou.game.effect import Effect 23 from pytouhou.game.effect import Effect
24 from pytouhou.game.text import Text 24 from pytouhou.game.text import Text, Counter
25 25
26 from os.path import join 26 from os.path import join
27 from pytouhou.ui.music import InfiniteWaveSource 27 from pytouhou.ui.music import InfiniteWaveSource
28 28
29 29
137 item.sprite.allow_dest_offset = True #XXX 137 item.sprite.allow_dest_offset = True #XXX
138 138
139 self.labels = { 139 self.labels = {
140 'highscore': Text((500, 58), ascii_wrapper, front, text='0'), 140 'highscore': Text((500, 58), ascii_wrapper, front, text='0'),
141 'score': Text((500, 82), ascii_wrapper, front, text='0'), 141 'score': Text((500, 82), ascii_wrapper, front, text='0'),
142 'player': Text((500, 122), ascii_wrapper, front, text='TODO'), 142 'player': Counter((500, 122), front, front, script=16, value=0),
143 'bombs': Text((500, 146), ascii_wrapper, front, text='TODO'), 143 'bombs': Counter((500, 146), front, front, script=17, value=0),
144 'power': Text((500, 186), ascii_wrapper, front, text='0'), 144 'power': Text((500, 186), ascii_wrapper, front, text='0'),
145 'graze': Text((500, 206), ascii_wrapper, front, text='0'), 145 'graze': Text((500, 206), ascii_wrapper, front, text='0'),
146 'points': Text((500, 226), ascii_wrapper, front, text='0'), 146 'points': Text((500, 226), ascii_wrapper, front, text='0'),
147 'framerate': Text((512, 464), ascii_wrapper, front), 147 'framerate': Text((512, 464), ascii_wrapper, front),
148 'debug?': Text((0, 464), ascii_wrapper, front), 148 'debug?': Text((0, 464), ascii_wrapper, front),
159 self.labels['highscore'].set_text('%09d' % self.highscore) 159 self.labels['highscore'].set_text('%09d' % self.highscore)
160 self.labels['score'].set_text('%09d' % player_state.effective_score) 160 self.labels['score'].set_text('%09d' % player_state.effective_score)
161 self.labels['power'].set_text('%d' % player_state.power) 161 self.labels['power'].set_text('%d' % player_state.power)
162 self.labels['graze'].set_text('%d' % player_state.graze) 162 self.labels['graze'].set_text('%d' % player_state.graze)
163 self.labels['points'].set_text('%d' % player_state.points) 163 self.labels['points'].set_text('%d' % player_state.points)
164 self.labels['player'].set_value(player_state.lives)
165 self.labels['bombs'].set_value(player_state.bombs)
164 166
165 167
166 168
167 class EoSDPlayer(Player): 169 class EoSDPlayer(Player):
168 def __init__(self, state, game, resource_loader, character): 170 def __init__(self, state, game, resource_loader, character):