comparison gamelib/menu.py @ 17:55f1969e41c9

Add simple menu screen
author Neil Muller <neil@dip.sun.ac.za>
date Sun, 22 Aug 2010 16:50:25 +0200
parents
children 87f8a46b88af
comparison
equal deleted inserted replaced
16:a02dc1e26c60 17:55f1969e41c9
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):
10 def __init__(self, shell):
11 Screen.__init__(self, shell)
12 self.shell = shell
13 StartButton = Button('Start New Game', action = self.start)
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 start(self):
24 print 'Starting the game'
25
26