view gamelib/main.py @ 99:367b1c9c3c6d

Restore mouse when returning to main menu
author Neil Muller <neil@dip.sun.ac.za>
date Tue, 24 Aug 2010 08:16:56 +0200
parents d449c4674da8
children 322cbc0a8cce
line wrap: on
line source

'''Game main module.

Contains the entry point used by the run_game.py script.

'''

import pygame
from pygame.locals import SWSURFACE
from albow.dialogs import alert
from albow.shell import Shell

from menu import MenuScreen
from gamescreen import GameScreen
from constants import SCREEN

class MainShell(Shell):
    def __init__(self, display):
        Shell.__init__(self, display)
        self.menu_screen = MenuScreen(self)
        self.game_screen = GameScreen(self)
        self.show_screen(self.menu_screen)

def main():
    pygame.display.init()
    pygame.font.init()
    display =  pygame.display.set_mode(SCREEN, SWSURFACE)
    shell = MainShell(display)
    shell.run()