Mercurial > rinkhals
annotate gamelib/gameover.py @ 555:296c73dcd286
Add high score dialog to main menu.
author | Simon Cross <hodgestar@gmail.com> |
---|---|
date | Sat, 28 Nov 2009 17:53:42 +0000 |
parents | bb75979b58e6 |
children | 8cd13b82585e |
rev | line source |
---|---|
139 | 1 """The Game Over Screen""" |
246
592bfad67488
Add 'You left' game over mode
Neil Muller <drnlmuller@gmail.com>
parents:
229
diff
changeset
|
2 import random |
555
296c73dcd286
Add high score dialog to main menu.
Simon Cross <hodgestar@gmail.com>
parents:
392
diff
changeset
|
3 import os |
139 | 4 |
5 from pgu import gui | |
312
dd1ffee5ccf5
Use different score tables fot the different modes. Refactor game modes code as a result
Neil Muller <drnlmuller@gmail.com>
parents:
296
diff
changeset
|
6 from pgu.high import Highs |
139 | 7 import pygame |
8 | |
9 import engine | |
10 import constants | |
11 import imagecache | |
555
296c73dcd286
Add high score dialog to main menu.
Simon Cross <hodgestar@gmail.com>
parents:
392
diff
changeset
|
12 import config |
139 | 13 |
246
592bfad67488
Add 'You left' game over mode
Neil Muller <drnlmuller@gmail.com>
parents:
229
diff
changeset
|
14 WON, LOST, LEFT = range(3) |
592bfad67488
Add 'You left' game over mode
Neil Muller <drnlmuller@gmail.com>
parents:
229
diff
changeset
|
15 |
295
d037e37c5240
Some endgame message changes.
Jeremy Thurgood <firxen@gmail.com>
parents:
246
diff
changeset
|
16 WON_MESSAGES = [ |
d037e37c5240
Some endgame message changes.
Jeremy Thurgood <firxen@gmail.com>
parents:
246
diff
changeset
|
17 "You won.", |
d037e37c5240
Some endgame message changes.
Jeremy Thurgood <firxen@gmail.com>
parents:
246
diff
changeset
|
18 "You survived!", |
d037e37c5240
Some endgame message changes.
Jeremy Thurgood <firxen@gmail.com>
parents:
246
diff
changeset
|
19 "Your chickens will one day rule the world.", |
d037e37c5240
Some endgame message changes.
Jeremy Thurgood <firxen@gmail.com>
parents:
246
diff
changeset
|
20 ] |
d037e37c5240
Some endgame message changes.
Jeremy Thurgood <firxen@gmail.com>
parents:
246
diff
changeset
|
21 |
d037e37c5240
Some endgame message changes.
Jeremy Thurgood <firxen@gmail.com>
parents:
246
diff
changeset
|
22 LOST_MESSAGES = [ |
d037e37c5240
Some endgame message changes.
Jeremy Thurgood <firxen@gmail.com>
parents:
246
diff
changeset
|
23 "You lost.", |
d037e37c5240
Some endgame message changes.
Jeremy Thurgood <firxen@gmail.com>
parents:
246
diff
changeset
|
24 "You failed to protect your chickens.", |
d037e37c5240
Some endgame message changes.
Jeremy Thurgood <firxen@gmail.com>
parents:
246
diff
changeset
|
25 "Unopposed, the foxes overrun the farm.", |
d037e37c5240
Some endgame message changes.
Jeremy Thurgood <firxen@gmail.com>
parents:
246
diff
changeset
|
26 ] |
d037e37c5240
Some endgame message changes.
Jeremy Thurgood <firxen@gmail.com>
parents:
246
diff
changeset
|
27 |
d037e37c5240
Some endgame message changes.
Jeremy Thurgood <firxen@gmail.com>
parents:
246
diff
changeset
|
28 LEFT_MESSAGES = [ |
d037e37c5240
Some endgame message changes.
Jeremy Thurgood <firxen@gmail.com>
parents:
246
diff
changeset
|
29 "You gave up.", |
d037e37c5240
Some endgame message changes.
Jeremy Thurgood <firxen@gmail.com>
parents:
246
diff
changeset
|
30 "You sold your farm.", |
d037e37c5240
Some endgame message changes.
Jeremy Thurgood <firxen@gmail.com>
parents:
246
diff
changeset
|
31 "Real life got in the way.", |
d037e37c5240
Some endgame message changes.
Jeremy Thurgood <firxen@gmail.com>
parents:
246
diff
changeset
|
32 "Are you siding with the foxes?", |
d037e37c5240
Some endgame message changes.
Jeremy Thurgood <firxen@gmail.com>
parents:
246
diff
changeset
|
33 "What will your chickens do now?", |
d037e37c5240
Some endgame message changes.
Jeremy Thurgood <firxen@gmail.com>
parents:
246
diff
changeset
|
34 ] |
246
592bfad67488
Add 'You left' game over mode
Neil Muller <drnlmuller@gmail.com>
parents:
229
diff
changeset
|
35 |
389
463802281182
Add basic level support (level choosing needs work)
Neil Muller <drnlmuller@gmail.com>
parents:
315
diff
changeset
|
36 def ScoreTable(level): |
229
96d440bebdaa
Non-permenant high score table
Neil Muller <drnlmuller@gmail.com>
parents:
159
diff
changeset
|
37 """Create and initialise a score table""" |
555
296c73dcd286
Add high score dialog to main menu.
Simon Cross <hodgestar@gmail.com>
parents:
392
diff
changeset
|
38 score_path = os.path.join(config.config.prefs_folder, "highscores.dat") |
296c73dcd286
Add high score dialog to main menu.
Simon Cross <hodgestar@gmail.com>
parents:
392
diff
changeset
|
39 all_scores = Highs(score_path, 4) |
296c73dcd286
Add high score dialog to main menu.
Simon Cross <hodgestar@gmail.com>
parents:
392
diff
changeset
|
40 all_scores.load() |
296c73dcd286
Add high score dialog to main menu.
Simon Cross <hodgestar@gmail.com>
parents:
392
diff
changeset
|
41 level_scores = all_scores[level.level_name] |
296c73dcd286
Add high score dialog to main menu.
Simon Cross <hodgestar@gmail.com>
parents:
392
diff
changeset
|
42 |
296c73dcd286
Add high score dialog to main menu.
Simon Cross <hodgestar@gmail.com>
parents:
392
diff
changeset
|
43 if not list(level_scores): |
296c73dcd286
Add high score dialog to main menu.
Simon Cross <hodgestar@gmail.com>
parents:
392
diff
changeset
|
44 authors = [auth[2] for auth in constants.AUTHORS] |
296c73dcd286
Add high score dialog to main menu.
Simon Cross <hodgestar@gmail.com>
parents:
392
diff
changeset
|
45 scores = [700+i*100 for i in range(len(authors))] |
296c73dcd286
Add high score dialog to main menu.
Simon Cross <hodgestar@gmail.com>
parents:
392
diff
changeset
|
46 random.shuffle(scores) |
229
96d440bebdaa
Non-permenant high score table
Neil Muller <drnlmuller@gmail.com>
parents:
159
diff
changeset
|
47 |
555
296c73dcd286
Add high score dialog to main menu.
Simon Cross <hodgestar@gmail.com>
parents:
392
diff
changeset
|
48 for auth, score in zip(authors, scores): |
296c73dcd286
Add high score dialog to main menu.
Simon Cross <hodgestar@gmail.com>
parents:
392
diff
changeset
|
49 level_scores.submit(score, auth, None) |
296c73dcd286
Add high score dialog to main menu.
Simon Cross <hodgestar@gmail.com>
parents:
392
diff
changeset
|
50 |
296c73dcd286
Add high score dialog to main menu.
Simon Cross <hodgestar@gmail.com>
parents:
392
diff
changeset
|
51 level_scores.save() |
296c73dcd286
Add high score dialog to main menu.
Simon Cross <hodgestar@gmail.com>
parents:
392
diff
changeset
|
52 |
296c73dcd286
Add high score dialog to main menu.
Simon Cross <hodgestar@gmail.com>
parents:
392
diff
changeset
|
53 return level_scores |
296c73dcd286
Add high score dialog to main menu.
Simon Cross <hodgestar@gmail.com>
parents:
392
diff
changeset
|
54 |
296c73dcd286
Add high score dialog to main menu.
Simon Cross <hodgestar@gmail.com>
parents:
392
diff
changeset
|
55 def create_game_over(gameboard, level): |
151
082868bea873
Refactor UI so that only a single gui.App is used. Pass all UI events via main_app. Change Toolbar table to use .td() everywhere. Move toolbar to top.
Simon Cross <hodgestar@gmail.com>
parents:
139
diff
changeset
|
56 """Create a game over screen""" |
555
296c73dcd286
Add high score dialog to main menu.
Simon Cross <hodgestar@gmail.com>
parents:
392
diff
changeset
|
57 game_over = GameOver(gameboard, level) |
157
e3572b907028
Add splash images to game over screen.
Simon Cross <hodgestar@gmail.com>
parents:
151
diff
changeset
|
58 return GameOverContainer(game_over, align=0, valign=0) |
139 | 59 |
555
296c73dcd286
Add high score dialog to main menu.
Simon Cross <hodgestar@gmail.com>
parents:
392
diff
changeset
|
60 |
139 | 61 class GameOverContainer(gui.Container): |
157
e3572b907028
Add splash images to game over screen.
Simon Cross <hodgestar@gmail.com>
parents:
151
diff
changeset
|
62 def __init__(self, game_over, *args, **kwargs): |
e3572b907028
Add splash images to game over screen.
Simon Cross <hodgestar@gmail.com>
parents:
151
diff
changeset
|
63 gui.Container.__init__(self, *args, **kwargs) |
e3572b907028
Add splash images to game over screen.
Simon Cross <hodgestar@gmail.com>
parents:
151
diff
changeset
|
64 self.add(game_over, 0, 0) |
246
592bfad67488
Add 'You left' game over mode
Neil Muller <drnlmuller@gmail.com>
parents:
229
diff
changeset
|
65 if game_over.survived == WON: |
592bfad67488
Add 'You left' game over mode
Neil Muller <drnlmuller@gmail.com>
parents:
229
diff
changeset
|
66 self.splash = imagecache.load_image("images/gameover_win.png", |
592bfad67488
Add 'You left' game over mode
Neil Muller <drnlmuller@gmail.com>
parents:
229
diff
changeset
|
67 ["darken_center"]) |
592bfad67488
Add 'You left' game over mode
Neil Muller <drnlmuller@gmail.com>
parents:
229
diff
changeset
|
68 elif game_over.survived == LOST: |
592bfad67488
Add 'You left' game over mode
Neil Muller <drnlmuller@gmail.com>
parents:
229
diff
changeset
|
69 self.splash = imagecache.load_image("images/gameover_lose.png", |
592bfad67488
Add 'You left' game over mode
Neil Muller <drnlmuller@gmail.com>
parents:
229
diff
changeset
|
70 ["darken_center"]) |
157
e3572b907028
Add splash images to game over screen.
Simon Cross <hodgestar@gmail.com>
parents:
151
diff
changeset
|
71 else: |
246
592bfad67488
Add 'You left' game over mode
Neil Muller <drnlmuller@gmail.com>
parents:
229
diff
changeset
|
72 self.splash = imagecache.load_image("images/splash.png", |
592bfad67488
Add 'You left' game over mode
Neil Muller <drnlmuller@gmail.com>
parents:
229
diff
changeset
|
73 ["darken_center"]) |
157
e3572b907028
Add splash images to game over screen.
Simon Cross <hodgestar@gmail.com>
parents:
151
diff
changeset
|
74 |
139 | 75 def paint(self, s): |
76 pygame.display.set_caption('Game Over') | |
157
e3572b907028
Add splash images to game over screen.
Simon Cross <hodgestar@gmail.com>
parents:
151
diff
changeset
|
77 pygame.display.get_surface().blit(self.splash, (0, 0)) |
139 | 78 gui.Container.paint(self, s) |
79 | |
555
296c73dcd286
Add high score dialog to main menu.
Simon Cross <hodgestar@gmail.com>
parents:
392
diff
changeset
|
80 |
139 | 81 class GameOver(gui.Table): |
246
592bfad67488
Add 'You left' game over mode
Neil Muller <drnlmuller@gmail.com>
parents:
229
diff
changeset
|
82 |
555
296c73dcd286
Add high score dialog to main menu.
Simon Cross <hodgestar@gmail.com>
parents:
392
diff
changeset
|
83 def __init__(self, gameboard, level, **params): |
139 | 84 gui.Table.__init__(self, **params) |
555
296c73dcd286
Add high score dialog to main menu.
Simon Cross <hodgestar@gmail.com>
parents:
392
diff
changeset
|
85 scoreboard = ScoreTable(level) |
139 | 86 |
87 def return_pressed(): | |
88 pygame.event.post(engine.GO_MAIN_MENU) | |
89 | |
90 def quit_pressed(): | |
91 pygame.event.post(engine.QUIT) | |
92 | |
229
96d440bebdaa
Non-permenant high score table
Neil Muller <drnlmuller@gmail.com>
parents:
159
diff
changeset
|
93 score = gameboard.cash + \ |
389
463802281182
Add basic level support (level choosing needs work)
Neil Muller <drnlmuller@gmail.com>
parents:
315
diff
changeset
|
94 level.sell_price_chicken * len(gameboard.chickens) + \ |
463802281182
Add basic level support (level choosing needs work)
Neil Muller <drnlmuller@gmail.com>
parents:
315
diff
changeset
|
95 level.sell_price_egg * gameboard.eggs |
229
96d440bebdaa
Non-permenant high score table
Neil Muller <drnlmuller@gmail.com>
parents:
159
diff
changeset
|
96 |
96d440bebdaa
Non-permenant high score table
Neil Muller <drnlmuller@gmail.com>
parents:
159
diff
changeset
|
97 self.tr() |
315
0a3161fec434
Check whether we've made the list before submitting the score
Neil Muller <drnlmuller@gmail.com>
parents:
312
diff
changeset
|
98 made_list = scoreboard.check(score) is not None |
392
bb75979b58e6
Move game_over logic from gameboard to level, for later reworking
Neil Muller <drnlmuller@gmail.com>
parents:
389
diff
changeset
|
99 if level.is_game_over(gameboard): |
246
592bfad67488
Add 'You left' game over mode
Neil Muller <drnlmuller@gmail.com>
parents:
229
diff
changeset
|
100 if len(gameboard.chickens) > 0: |
592bfad67488
Add 'You left' game over mode
Neil Muller <drnlmuller@gmail.com>
parents:
229
diff
changeset
|
101 self.survived = WON |
592bfad67488
Add 'You left' game over mode
Neil Muller <drnlmuller@gmail.com>
parents:
229
diff
changeset
|
102 scoreboard.submit(score, 'Player') |
592bfad67488
Add 'You left' game over mode
Neil Muller <drnlmuller@gmail.com>
parents:
229
diff
changeset
|
103 message = random.choice(WON_MESSAGES) |
592bfad67488
Add 'You left' game over mode
Neil Muller <drnlmuller@gmail.com>
parents:
229
diff
changeset
|
104 else: |
592bfad67488
Add 'You left' game over mode
Neil Muller <drnlmuller@gmail.com>
parents:
229
diff
changeset
|
105 self.survived = LOST |
592bfad67488
Add 'You left' game over mode
Neil Muller <drnlmuller@gmail.com>
parents:
229
diff
changeset
|
106 message = random.choice(LOST_MESSAGES) |
139 | 107 else: |
246
592bfad67488
Add 'You left' game over mode
Neil Muller <drnlmuller@gmail.com>
parents:
229
diff
changeset
|
108 self.survived = LEFT |
592bfad67488
Add 'You left' game over mode
Neil Muller <drnlmuller@gmail.com>
parents:
229
diff
changeset
|
109 message = random.choice(LEFT_MESSAGES) |
592bfad67488
Add 'You left' game over mode
Neil Muller <drnlmuller@gmail.com>
parents:
229
diff
changeset
|
110 self.td(gui.Label(message, color=constants.FG_COLOR), |
592bfad67488
Add 'You left' game over mode
Neil Muller <drnlmuller@gmail.com>
parents:
229
diff
changeset
|
111 colspan=3) |
296
010ab166c582
Add killed fox count to gameover. Tweak spacing
Neil Muller <drnlmuller@gmail.com>
parents:
295
diff
changeset
|
112 self.add_spacer() |
229
96d440bebdaa
Non-permenant high score table
Neil Muller <drnlmuller@gmail.com>
parents:
159
diff
changeset
|
113 # show the scoreboard |
96d440bebdaa
Non-permenant high score table
Neil Muller <drnlmuller@gmail.com>
parents:
159
diff
changeset
|
114 |
312
dd1ffee5ccf5
Use different score tables fot the different modes. Refactor game modes code as a result
Neil Muller <drnlmuller@gmail.com>
parents:
296
diff
changeset
|
115 self.tr() |
389
463802281182
Add basic level support (level choosing needs work)
Neil Muller <drnlmuller@gmail.com>
parents:
315
diff
changeset
|
116 self.td(gui.Label('Level: %s' % level.level_name, color=constants.FG_COLOR), |
312
dd1ffee5ccf5
Use different score tables fot the different modes. Refactor game modes code as a result
Neil Muller <drnlmuller@gmail.com>
parents:
296
diff
changeset
|
117 colspan=3) |
dd1ffee5ccf5
Use different score tables fot the different modes. Refactor game modes code as a result
Neil Muller <drnlmuller@gmail.com>
parents:
296
diff
changeset
|
118 |
229
96d440bebdaa
Non-permenant high score table
Neil Muller <drnlmuller@gmail.com>
parents:
159
diff
changeset
|
119 for highscore in scoreboard: |
96d440bebdaa
Non-permenant high score table
Neil Muller <drnlmuller@gmail.com>
parents:
159
diff
changeset
|
120 self.tr() |
96d440bebdaa
Non-permenant high score table
Neil Muller <drnlmuller@gmail.com>
parents:
159
diff
changeset
|
121 self.td(gui.Label(highscore.name, color=constants.FG_COLOR), colspan=2) |
96d440bebdaa
Non-permenant high score table
Neil Muller <drnlmuller@gmail.com>
parents:
159
diff
changeset
|
122 self.td(gui.Label('%d' % highscore.score, color=constants.FG_COLOR)) |
139 | 123 |
124 self.tr() | |
125 self.td(gui.Label("Groats : %d" % gameboard.cash, | |
126 color=constants.FG_COLOR)) | |
127 self.td(gui.Label(" Chickens : %d " % len(gameboard.chickens), | |
128 color=constants.FG_COLOR)) | |
129 self.td(gui.Label(" Eggs : %d" % gameboard.eggs, | |
130 color=constants.FG_COLOR)) | |
296
010ab166c582
Add killed fox count to gameover. Tweak spacing
Neil Muller <drnlmuller@gmail.com>
parents:
295
diff
changeset
|
131 self.add_spacer() |
010ab166c582
Add killed fox count to gameover. Tweak spacing
Neil Muller <drnlmuller@gmail.com>
parents:
295
diff
changeset
|
132 self.tr() |
010ab166c582
Add killed fox count to gameover. Tweak spacing
Neil Muller <drnlmuller@gmail.com>
parents:
295
diff
changeset
|
133 self.td(gui.Label("You killed %d foxes" % gameboard.killed_foxes, |
010ab166c582
Add killed fox count to gameover. Tweak spacing
Neil Muller <drnlmuller@gmail.com>
parents:
295
diff
changeset
|
134 color=constants.FG_COLOR), colspan=3) |
010ab166c582
Add killed fox count to gameover. Tweak spacing
Neil Muller <drnlmuller@gmail.com>
parents:
295
diff
changeset
|
135 self.add_spacer() |
139 | 136 self.tr() |
229
96d440bebdaa
Non-permenant high score table
Neil Muller <drnlmuller@gmail.com>
parents:
159
diff
changeset
|
137 self.td(gui.Label("Final score : %d" % score, |
139 | 138 color=constants.FG_COLOR), colspan=3) |
315
0a3161fec434
Check whether we've made the list before submitting the score
Neil Muller <drnlmuller@gmail.com>
parents:
312
diff
changeset
|
139 if made_list: |
555
296c73dcd286
Add high score dialog to main menu.
Simon Cross <hodgestar@gmail.com>
parents:
392
diff
changeset
|
140 scoreboard.save() |
229
96d440bebdaa
Non-permenant high score table
Neil Muller <drnlmuller@gmail.com>
parents:
159
diff
changeset
|
141 self.tr() |
246
592bfad67488
Add 'You left' game over mode
Neil Muller <drnlmuller@gmail.com>
parents:
229
diff
changeset
|
142 if self.survived == WON: |
229
96d440bebdaa
Non-permenant high score table
Neil Muller <drnlmuller@gmail.com>
parents:
159
diff
changeset
|
143 self.td(gui.Label("You made the high scores", |
96d440bebdaa
Non-permenant high score table
Neil Muller <drnlmuller@gmail.com>
parents:
159
diff
changeset
|
144 color=constants.FG_COLOR), colspan=3) |
96d440bebdaa
Non-permenant high score table
Neil Muller <drnlmuller@gmail.com>
parents:
159
diff
changeset
|
145 else: |
96d440bebdaa
Non-permenant high score table
Neil Muller <drnlmuller@gmail.com>
parents:
159
diff
changeset
|
146 self.td(gui.Label("Pity, you could have made the high scores", |
96d440bebdaa
Non-permenant high score table
Neil Muller <drnlmuller@gmail.com>
parents:
159
diff
changeset
|
147 color=constants.FG_COLOR), colspan=3) |
139 | 148 |
296
010ab166c582
Add killed fox count to gameover. Tweak spacing
Neil Muller <drnlmuller@gmail.com>
parents:
295
diff
changeset
|
149 self.add_spacer(50) |
157
e3572b907028
Add splash images to game over screen.
Simon Cross <hodgestar@gmail.com>
parents:
151
diff
changeset
|
150 |
139 | 151 return_button = gui.Button("Return to Main Menu") |
152 return_button.connect(gui.CLICK, return_pressed) | |
153 | |
154 quit_button = gui.Button("Quit") | |
155 quit_button.connect(gui.CLICK, quit_pressed) | |
156 | |
157 style = { | |
158 "padding_bottom": 15, | |
159 } | |
160 td_kwargs = { | |
161 "align": 0, | |
162 "style": style, | |
163 "colspan": 3, | |
164 } | |
165 | |
166 self.tr() | |
167 self.td(return_button, **td_kwargs) | |
168 | |
169 self.tr() | |
170 self.td(quit_button, **td_kwargs) | |
296
010ab166c582
Add killed fox count to gameover. Tweak spacing
Neil Muller <drnlmuller@gmail.com>
parents:
295
diff
changeset
|
171 |
010ab166c582
Add killed fox count to gameover. Tweak spacing
Neil Muller <drnlmuller@gmail.com>
parents:
295
diff
changeset
|
172 def add_spacer(self, height=5): |
010ab166c582
Add killed fox count to gameover. Tweak spacing
Neil Muller <drnlmuller@gmail.com>
parents:
295
diff
changeset
|
173 self.tr() |
010ab166c582
Add killed fox count to gameover. Tweak spacing
Neil Muller <drnlmuller@gmail.com>
parents:
295
diff
changeset
|
174 self.td(gui.Spacer(0, height), colspan=3) |
555
296c73dcd286
Add high score dialog to main menu.
Simon Cross <hodgestar@gmail.com>
parents:
392
diff
changeset
|
175 |
296c73dcd286
Add high score dialog to main menu.
Simon Cross <hodgestar@gmail.com>
parents:
392
diff
changeset
|
176 |
296c73dcd286
Add high score dialog to main menu.
Simon Cross <hodgestar@gmail.com>
parents:
392
diff
changeset
|
177 class Scoreboard(gui.Table): |
296c73dcd286
Add high score dialog to main menu.
Simon Cross <hodgestar@gmail.com>
parents:
392
diff
changeset
|
178 |
296c73dcd286
Add high score dialog to main menu.
Simon Cross <hodgestar@gmail.com>
parents:
392
diff
changeset
|
179 def __init__(self, level, **params): |
296c73dcd286
Add high score dialog to main menu.
Simon Cross <hodgestar@gmail.com>
parents:
392
diff
changeset
|
180 gui.Table.__init__(self, **params) |
296c73dcd286
Add high score dialog to main menu.
Simon Cross <hodgestar@gmail.com>
parents:
392
diff
changeset
|
181 |
296c73dcd286
Add high score dialog to main menu.
Simon Cross <hodgestar@gmail.com>
parents:
392
diff
changeset
|
182 scoreboard = ScoreTable(level) |
296c73dcd286
Add high score dialog to main menu.
Simon Cross <hodgestar@gmail.com>
parents:
392
diff
changeset
|
183 |
296c73dcd286
Add high score dialog to main menu.
Simon Cross <hodgestar@gmail.com>
parents:
392
diff
changeset
|
184 self.tr() |
296c73dcd286
Add high score dialog to main menu.
Simon Cross <hodgestar@gmail.com>
parents:
392
diff
changeset
|
185 self.td(gui.Label('Level: %s' % level.level_name, colspan=3)) |
296c73dcd286
Add high score dialog to main menu.
Simon Cross <hodgestar@gmail.com>
parents:
392
diff
changeset
|
186 |
296c73dcd286
Add high score dialog to main menu.
Simon Cross <hodgestar@gmail.com>
parents:
392
diff
changeset
|
187 for highscore in scoreboard: |
296c73dcd286
Add high score dialog to main menu.
Simon Cross <hodgestar@gmail.com>
parents:
392
diff
changeset
|
188 self.tr() |
296c73dcd286
Add high score dialog to main menu.
Simon Cross <hodgestar@gmail.com>
parents:
392
diff
changeset
|
189 self.td(gui.Label(highscore.name), colspan=2) |
296c73dcd286
Add high score dialog to main menu.
Simon Cross <hodgestar@gmail.com>
parents:
392
diff
changeset
|
190 self.td(gui.Label('%d' % highscore.score)) |
296c73dcd286
Add high score dialog to main menu.
Simon Cross <hodgestar@gmail.com>
parents:
392
diff
changeset
|
191 |