Mercurial > mamba
view mamba/__main__.py @ 48:a70ded879f46
Move argument checking into mamba.options.
author | Simon Cross <hodgestar@gmail.com> |
---|---|
date | Sun, 11 Sep 2011 15:22:41 +0200 |
parents | 8521c142cd43 |
children | e5f36843f7cd |
line wrap: on
line source
"""Main module for the game""" import sys import pygame from pygame.locals import SWSURFACE from mamba.constants import SCREEN from mamba.options import options, parse_args, check_args from mamba.engine import Engine from mamba.sound import SoundSystem from mamba.habitats.mainmenu import MainMenu from mamba.habitats.level import LevelHabitat from mamba.habitats.editor import EditorHabitat def main(): """Launch the currently unnamed mamab game""" parse_args(sys.argv) if not check_args(): sys.exit(1) SoundSystem(options.sound) pygame.display.init() pygame.font.init() pygame.display.set_mode(SCREEN, SWSURFACE) pygame.display.set_caption('Mamba') if options.edit: start = EditorHabitat(options.level) elif options.level is not None: start = LevelHabitat(options.level) else: start = MainMenu() engine = Engine() engine.set_habitat(start) engine.run()