comparison gamelib/gameover.py @ 151:082868bea873

Refactor UI so that only a single gui.App is used. Pass all UI events via main_app. Change Toolbar table to use .td() everywhere. Move toolbar to top.
author Simon Cross <hodgestar@gmail.com>
date Thu, 03 Sep 2009 20:32:56 +0000
parents 1d73de63bd71
children e3572b907028
comparison
equal deleted inserted replaced
150:89d2360d4350 151:082868bea873
5 5
6 import engine 6 import engine
7 import constants 7 import constants
8 import imagecache 8 import imagecache
9 9
10 def add_game_over(app, gameboard): 10 def create_game_over(gameboard):
11 """Add the game over menu to the app""" 11 """Create a game over screen"""
12 for widget in app.widgets[:]:
13 app.remove(widget)
14 game_over = GameOver(gameboard) 12 game_over = GameOver(gameboard)
15 13
16 c = GameOverContainer(align=0, valign=0) 14 c = GameOverContainer(align=0, valign=0)
17 c.add(game_over, 0, 0) 15 c.add(game_over, 0, 0)
18 16
19 app.init(c) 17 return c
20 18
21 class GameOverContainer(gui.Container): 19 class GameOverContainer(gui.Container):
22 def paint(self, s): 20 def paint(self, s):
23 pygame.display.set_caption('Game Over') 21 pygame.display.set_caption('Game Over')
24 #splash = imagecache.load_image("images/splash.png") 22 #splash = imagecache.load_image("images/splash.png")