Mercurial > rinkhals
view gamelib/main.py @ 150:89d2360d4350
select chicken, henhouse, hendominium or watchtower; fox death, chicken death; muzzle flash
author | Adrianna Pińska <adrianna.pinska@gmail.com> |
---|---|
date | Thu, 03 Sep 2009 20:24:37 +0000 |
parents | 1d73de63bd71 |
children | 082868bea873 |
line wrap: on
line source
'''Game main module. 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 pygame from pgu import gui from pygame.locals import SWSURFACE from mainmenu import MenuContainer, MainMenu from engine import Engine, MainMenuState from sound import init_sound import constants def create_app(): """Create the app.""" app = gui.App() return app def main(): """Main script.""" init_sound() screen = pygame.display.set_mode(constants.SCREEN, SWSURFACE) main_app = create_app() engine = Engine(main_app) try: engine.run(MainMenuState(engine), screen) except KeyboardInterrupt: pass