Mercurial > pyntnclick
comparison gamelib/menu.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 | 87f8a46b88af |
children | e5c043aeed65 |
comparison
equal
deleted
inserted
replaced
23:1e90a3e4618e | 24:9d5de13e2ac3 |
---|---|
7 from albow.layout import Column | 7 from albow.layout import Column |
8 | 8 |
9 class MenuScreen(Screen): | 9 class MenuScreen(Screen): |
10 def __init__(self, shell): | 10 def __init__(self, shell): |
11 Screen.__init__(self, shell) | 11 Screen.__init__(self, shell) |
12 StartButton = Button('Start New Game', action = self.start) | 12 self.shell = shell |
13 StartButton = Button('Start New Game', action = self.start) | |
13 QuitButton = Button('Quit', action = shell.quit) | 14 QuitButton = Button('Quit', action = shell.quit) |
14 Title = Label('Caught! ... In SPAACE') | 15 Title = Label('Caught! ... In SPAACE') |
15 menu = Column([ | 16 menu = Column([ |
16 Title, | 17 Title, |
17 StartButton, | 18 StartButton, |
19 ], align='l', spacing=20) | 20 ], align='l', spacing=20) |
20 self.add_centered(menu) | 21 self.add_centered(menu) |
21 | 22 |
22 def start(self): | 23 def start(self): |
23 print 'Starting the game' | 24 print 'Starting the game' |
25 self.shell.show_screen(self.shell.game_screen) | |
24 | 26 |
25 | 27 |