Mercurial > rinkhals
comparison gamelib/gameover.py @ 296:010ab166c582
Add killed fox count to gameover. Tweak spacing
author | Neil Muller <drnlmuller@gmail.com> |
---|---|
date | Sat, 05 Sep 2009 16:27:31 +0000 |
parents | d037e37c5240 |
children | dd1ffee5ccf5 |
comparison
equal
deleted
inserted
replaced
295:d037e37c5240 | 296:010ab166c582 |
---|---|
92 else: | 92 else: |
93 self.survived = LEFT | 93 self.survived = LEFT |
94 message = random.choice(LEFT_MESSAGES) | 94 message = random.choice(LEFT_MESSAGES) |
95 self.td(gui.Label(message, color=constants.FG_COLOR), | 95 self.td(gui.Label(message, color=constants.FG_COLOR), |
96 colspan=3) | 96 colspan=3) |
97 self.add_spacer() | |
97 # show the scoreboard | 98 # show the scoreboard |
98 | 99 |
99 for highscore in scoreboard: | 100 for highscore in scoreboard: |
100 self.tr() | 101 self.tr() |
101 self.td(gui.Label(highscore.name, color=constants.FG_COLOR), colspan=2) | 102 self.td(gui.Label(highscore.name, color=constants.FG_COLOR), colspan=2) |
106 color=constants.FG_COLOR)) | 107 color=constants.FG_COLOR)) |
107 self.td(gui.Label(" Chickens : %d " % len(gameboard.chickens), | 108 self.td(gui.Label(" Chickens : %d " % len(gameboard.chickens), |
108 color=constants.FG_COLOR)) | 109 color=constants.FG_COLOR)) |
109 self.td(gui.Label(" Eggs : %d" % gameboard.eggs, | 110 self.td(gui.Label(" Eggs : %d" % gameboard.eggs, |
110 color=constants.FG_COLOR)) | 111 color=constants.FG_COLOR)) |
112 self.add_spacer() | |
113 self.tr() | |
114 self.td(gui.Label("You killed %d foxes" % gameboard.killed_foxes, | |
115 color=constants.FG_COLOR), colspan=3) | |
116 self.add_spacer() | |
111 self.tr() | 117 self.tr() |
112 self.td(gui.Label("Final score : %d" % score, | 118 self.td(gui.Label("Final score : %d" % score, |
113 color=constants.FG_COLOR), colspan=3) | 119 color=constants.FG_COLOR), colspan=3) |
114 if scoreboard.check(score) is not None: | 120 if scoreboard.check(score) is not None: |
115 self.tr() | 121 self.tr() |
118 color=constants.FG_COLOR), colspan=3) | 124 color=constants.FG_COLOR), colspan=3) |
119 else: | 125 else: |
120 self.td(gui.Label("Pity, you could have made the high scores", | 126 self.td(gui.Label("Pity, you could have made the high scores", |
121 color=constants.FG_COLOR), colspan=3) | 127 color=constants.FG_COLOR), colspan=3) |
122 | 128 |
123 self.tr() | 129 self.add_spacer(50) |
124 self.td(gui.Spacer(0, 50), colspan=3) | |
125 | 130 |
126 return_button = gui.Button("Return to Main Menu") | 131 return_button = gui.Button("Return to Main Menu") |
127 return_button.connect(gui.CLICK, return_pressed) | 132 return_button.connect(gui.CLICK, return_pressed) |
128 | 133 |
129 quit_button = gui.Button("Quit") | 134 quit_button = gui.Button("Quit") |
141 self.tr() | 146 self.tr() |
142 self.td(return_button, **td_kwargs) | 147 self.td(return_button, **td_kwargs) |
143 | 148 |
144 self.tr() | 149 self.tr() |
145 self.td(quit_button, **td_kwargs) | 150 self.td(quit_button, **td_kwargs) |
151 | |
152 def add_spacer(self, height=5): | |
153 self.tr() | |
154 self.td(gui.Spacer(0, height), colspan=3) |