comparison pytouhou/interfaces/eosd.py @ 590:e15672733c93

Switch to Python 3.x instead of 2.7.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Tue, 30 Sep 2014 17:14:24 +0200
parents 1e9ea6519f3c
children ab131d04987d
comparison
equal deleted inserted replaced
589:0768122da817 590:e15672733c93
38 item.sprite.allow_dest_offset = True #XXX 38 item.sprite.allow_dest_offset = True #XXX
39 39
40 self.level_start = [] 40 self.level_start = []
41 41
42 self.labels = { 42 self.labels = {
43 'highscore': Text((500, 58), self.ascii_anm, front, text='0'), 43 'highscore': Text((500, 58), self.ascii_anm, front, text=b'0'),
44 'score': Text((500, 82), self.ascii_anm, front, text='0'), 44 'score': Text((500, 82), self.ascii_anm, front, text=b'0'),
45 'player': Counter((500, 122), front, front, script=16, value=0), 45 'player': Counter((500, 122), front, front, script=16, value=0),
46 'bombs': Counter((500, 146), front, front, script=17, value=0), 46 'bombs': Counter((500, 146), front, front, script=17, value=0),
47 'power': Text((500, 186), self.ascii_anm, front, text='0'), 47 'power': Text((500, 186), self.ascii_anm, front, text=b'0'),
48 'graze': Text((500, 206), self.ascii_anm, front, text='0'), 48 'graze': Text((500, 206), self.ascii_anm, front, text=b'0'),
49 'points': Text((500, 226), self.ascii_anm, front, text='0'), 49 'points': Text((500, 226), self.ascii_anm, front, text=b'0'),
50 'framerate': Text((512, 464), self.ascii_anm, front), 50 'framerate': Text((512, 464), self.ascii_anm, front),
51 'debug?': Text((0, 464), self.ascii_anm, front), 51 'debug?': Text((0, 464), self.ascii_anm, front),
52 52
53 # Only when there is a boss. 53 # Only when there is a boss.
54 'boss_lives': Text((80, 16), self.ascii_anm), 54 'boss_lives': Text((80, 16), self.ascii_anm),
66 66
67 67
68 def start_stage(self, game, stage): 68 def start_stage(self, game, stage):
69 self.game = game 69 self.game = game
70 if stage < 6: 70 if stage < 6:
71 text = 'STAGE %d' % stage 71 text = ('STAGE %d' % stage).encode()
72 elif stage == 6: 72 elif stage == 6:
73 text = 'FINAL STAGE' 73 text = b'FINAL STAGE'
74 elif stage == 7: 74 elif stage == 7:
75 text = 'EXTRA STAGE' 75 text = b'EXTRA STAGE'
76 76
77 self.stage_name = NativeText((192, 200), unicode(game.std.name), shadow=True, align='center') 77 self.stage_name = NativeText((192, 200), game.std.name, shadow=True, align='center')
78 self.stage_name.set_timeout(240, effect='fadeout', duration=60, start=120) 78 self.stage_name.set_timeout(240, effect='fadeout', duration=60, start=120)
79 79
80 self.set_song_name(game.std.bgms[0][0]) 80 self.set_song_name(game.std.bgms[0][0])
81 81
82 self.level_start = [Text((16+384/2, 200), self.ascii_anm, text=text, align='center')] #TODO: find the exact location. 82 self.level_start = [Text((16+384/2, 200), self.ascii_anm, text=text, align='center')] #TODO: find the exact location.
84 self.level_start[0].set_color('yellow') 84 self.level_start[0].set_color('yellow')
85 85
86 86
87 def set_song_name(self, name): 87 def set_song_name(self, name):
88 #TODO: use the correct animation. 88 #TODO: use the correct animation.
89 self.song_name = NativeText((384, 432), u'♪ ' + name, shadow=True, align='right') 89 self.song_name = NativeText((384, 432), '♪ ' + name, shadow=True, align='right')
90 self.song_name.set_timeout(240, effect='fadeout', duration=60, start=120) 90 self.song_name.set_timeout(240, effect='fadeout', duration=60, start=120)
91 91
92 92
93 def set_boss_life(self): 93 def set_boss_life(self):
94 if not self.game.boss: 94 if not self.game.boss: