diff gamelib/main.py @ 389:463802281182

Add basic level support (level choosing needs work)
author Neil Muller <drnlmuller@gmail.com>
date Thu, 29 Oct 2009 20:55:37 +0000
parents 4cc0b3627f83
children 03d5cb669298
line wrap: on
line diff
--- a/gamelib/main.py	Thu Oct 29 20:54:32 2009 +0000
+++ b/gamelib/main.py	Thu Oct 29 20:55:37 2009 +0000
@@ -14,6 +14,7 @@
 from sound import init_sound
 import constants
 import data
+import sys
 
 def create_main_app(screen):
     """Create an app with a background widget."""
@@ -33,7 +34,12 @@
 
     from engine import Engine, MainMenuState
 
-    engine = Engine(main_app)
+    if len(sys.argv) > 1:
+        level_name = sys.argv[1]
+    else:
+        level_name = 'two_weeks'
+
+    engine = Engine(main_app, level_name)
     try:
         engine.run(MainMenuState(engine), screen)
     except KeyboardInterrupt: