diff 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
line wrap: on
line diff
--- a/gamelib/main.py	Sun Aug 22 16:31:21 2010 +0200
+++ b/gamelib/main.py	Sun Aug 22 16:50:25 2010 +0200
@@ -2,12 +2,25 @@
 
 Contains the entry point used by the run_game.py script.
 
-Feel free to put all your game code here, or in other modules in this "gamelib"
-package.
 '''
 
 import data
 
+import pygame
+from pygame.locals import SWSURFACE, SRCALPHA
+from albow.dialogs import alert
+from albow.shell import Shell
+from menu import MenuScreen
+
+class MainShell(Shell):
+    def __init__(self, display):
+        Shell.__init__(self, display)
+        self.menu_screen = MenuScreen(self)
+        self.show_screen(self.menu_screen)
+
 def main():
-    print "Hello from your game's main()"
-    print data.load('sample.txt').read()
+    pygame.init()
+    display =  pygame.display.set_mode((800, 600))
+    shell = MainShell(display)
+    shell.run()
+