Mercurial > boomslang
annotate gamelib/menu.py @ 26:0a68d137f509
Initial inventory palette thing.
author | Jeremy Thurgood <firxen@gmail.com> |
---|---|
date | Sun, 22 Aug 2010 18:38:56 +0200 |
parents | 9d5de13e2ac3 |
children | e5c043aeed65 |
rev | line source |
---|---|
17 | 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 MenuScreen(Screen): | |
19 | 10 def __init__(self, shell): |
11 Screen.__init__(self, shell) | |
24
9d5de13e2ac3
Add a game screen. So far, the game content looks a *lot* like the main menu.
Jeremy Thurgood <firxen@gmail.com>
parents:
19
diff
changeset
|
12 self.shell = shell |
9d5de13e2ac3
Add a game screen. So far, the game content looks a *lot* like the main menu.
Jeremy Thurgood <firxen@gmail.com>
parents:
19
diff
changeset
|
13 StartButton = Button('Start New Game', action = self.start) |
19 | 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) | |
17 | 22 |
19 | 23 def start(self): |
24 print 'Starting the game' | |
24
9d5de13e2ac3
Add a game screen. So far, the game content looks a *lot* like the main menu.
Jeremy Thurgood <firxen@gmail.com>
parents:
19
diff
changeset
|
25 self.shell.show_screen(self.shell.game_screen) |
17 | 26 |
27 |