comparison gamelib/main.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 f2c3b516741b
children 177e3a7825e8
comparison
equal deleted inserted replaced
16:a02dc1e26c60 17:55f1969e41c9
1 '''Game main module. 1 '''Game main module.
2 2
3 Contains the entry point used by the run_game.py script. 3 Contains the entry point used by the run_game.py script.
4 4
5 Feel free to put all your game code here, or in other modules in this "gamelib"
6 package.
7 ''' 5 '''
8 6
9 import data 7 import data
10 8
9 import pygame
10 from pygame.locals import SWSURFACE, SRCALPHA
11 from albow.dialogs import alert
12 from albow.shell import Shell
13 from menu import MenuScreen
14
15 class MainShell(Shell):
16 def __init__(self, display):
17 Shell.__init__(self, display)
18 self.menu_screen = MenuScreen(self)
19 self.show_screen(self.menu_screen)
20
11 def main(): 21 def main():
12 print "Hello from your game's main()" 22 pygame.init()
13 print data.load('sample.txt').read() 23 display = pygame.display.set_mode((800, 600))
24 shell = MainShell(display)
25 shell.run()
26