Mercurial > boomslang
diff gamelib/menu.py @ 100:b5b6cbf556e6
Make start new game start a new game. Add Resume to main menu
author | Neil Muller <neil@dip.sun.ac.za> |
---|---|
date | Tue, 24 Aug 2010 08:48:50 +0200 |
parents | c76f2fad2af5 |
children | 97322b78d1c1 |
line wrap: on
line diff
--- a/gamelib/menu.py Tue Aug 24 08:16:56 2010 +0200 +++ b/gamelib/menu.py Tue Aug 24 08:48:50 2010 +0200 @@ -10,17 +10,28 @@ def __init__(self, shell): Screen.__init__(self, shell) StartButton = Button('Start New Game', action = self.start) + ResumeButton = Button('Resume Game', action = self.resume, + enable=self.check_running) QuitButton = Button('Quit', action = shell.quit) Title = Label('Suspended Sentence') menu = Column([ Title, StartButton, + ResumeButton, QuitButton, ], align='l', spacing=20) self.add_centered(menu) def start(self): - print 'Starting the game' + self.shell.game_screen.start_game() self.shell.show_screen(self.shell.game_screen) + def check_running(self): + return self.shell.game_screen.running + def resume(self): + if self.shell.game_screen.running: + self.shell.show_screen(self.shell.game_screen) + + +