Mercurial > boomslang
comparison gamelib/gamescreen.py @ 24:9d5de13e2ac3
Add a game screen. So far, the game content looks a *lot* like the main menu.
author | Jeremy Thurgood <firxen@gmail.com> |
---|---|
date | Sun, 22 Aug 2010 18:09:25 +0200 |
parents | |
children | 0a68d137f509 |
comparison
equal
deleted
inserted
replaced
23:1e90a3e4618e | 24:9d5de13e2ac3 |
---|---|
1 # menu.py | |
2 # Copyright Boomslang team, 2010 (see COPYING File) | |
3 # Main menu for the game | |
4 | |
5 from albow.screen import Screen | |
6 from albow.controls import Button, Label | |
7 from albow.layout import Column | |
8 | |
9 class GameScreen(Screen): | |
10 def __init__(self, shell): | |
11 Screen.__init__(self, shell) | |
12 self.shell = shell | |
13 StartButton = Button('Main Menu', action = self.main_menu) | |
14 QuitButton = Button('Quit', action = shell.quit) | |
15 Title = Label('Caught! ... In SPAACE') | |
16 menu = Column([ | |
17 Title, | |
18 StartButton, | |
19 QuitButton, | |
20 ], align='l', spacing=20) | |
21 self.add_centered(menu) | |
22 | |
23 def main_menu(self): | |
24 print 'Returning to menu' | |
25 self.shell.show_screen(self.shell.menu_screen) | |
26 | |
27 |