view gamelib/main.py @ 32:18cb1af411ef

Add helper for adding items. Give items names. Make things take a rectangle.
author Simon Cross <hodgestar+bzr@gmail.com>
date Sun, 22 Aug 2010 19:38:32 +0200
parents 0f25f7b9b37a
children d449c4674da8
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, SRCALPHA
from albow.dialogs import alert
from albow.shell import Shell

import data
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, SRCALPHA)
    shell = MainShell(display)
    shell.run()