Mercurial > boomslang
comparison gamelib/endscreen.py @ 599:2d2ea51b73ad pyntnclick
Move menu.py and endscreen.py to gamelib. Add default versions for new games
author | Neil Muller <neil@dip.sun.ac.za> |
---|---|
date | Sat, 11 Feb 2012 18:46:19 +0200 |
parents | pyntnclick/endscreen.py@f20d211d2c91 |
children | f2b1ddcc4986 |
comparison
equal
deleted
inserted
replaced
598:c1b5e982809b | 599:2d2ea51b73ad |
---|---|
1 # endscreen.py | |
2 # Copyright Boomslang team, 2010 (see COPYING File) | |
3 # Victory screen for the game | |
4 | |
5 from albow.screen import Screen | |
6 | |
7 from pyntnclick.widgets import BoomImageButton | |
8 | |
9 | |
10 class EndImageButton(BoomImageButton): | |
11 | |
12 FOLDER = 'won' | |
13 | |
14 | |
15 class EndScreen(Screen): | |
16 def __init__(self, shell, game_description): | |
17 Screen.__init__(self, shell) | |
18 self.background = game_description.resource.get_image( | |
19 ('won', 'won.png')) | |
20 self._menu_button = EndImageButton('menu.png', 26, 500, | |
21 action=self.main_menu) | |
22 self._quit_button = EndImageButton('quit.png', 250, 500, | |
23 action=shell.quit) | |
24 self.add(self._menu_button) | |
25 self.add(self._quit_button) | |
26 | |
27 def draw(self, surface): | |
28 surface.blit(self.background, (0, 0)) | |
29 self._menu_button.draw(surface) | |
30 self._quit_button.draw(surface) | |
31 | |
32 def main_menu(self): | |
33 self.shell.show_screen(self.shell.menu_screen) |