Mercurial > boomslang
annotate gamelib/main.py @ 25:f9e697e0c6ba
Don't initialise the entire pygame
author | Stefano Rivera <stefano@rivera.za.net> |
---|---|
date | Sun, 22 Aug 2010 18:14:05 +0200 |
parents | 9d5de13e2ac3 |
children | 0a68d137f509 |
rev | line source |
---|---|
0
f2c3b516741b
Theme is 'Caught'. Start with Skellington 1.9.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
diff
changeset
|
1 '''Game main module. |
f2c3b516741b
Theme is 'Caught'. Start with Skellington 1.9.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
diff
changeset
|
2 |
f2c3b516741b
Theme is 'Caught'. Start with Skellington 1.9.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
diff
changeset
|
3 Contains the entry point used by the run_game.py script. |
f2c3b516741b
Theme is 'Caught'. Start with Skellington 1.9.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
diff
changeset
|
4 |
f2c3b516741b
Theme is 'Caught'. Start with Skellington 1.9.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
diff
changeset
|
5 ''' |
f2c3b516741b
Theme is 'Caught'. Start with Skellington 1.9.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
diff
changeset
|
6 |
f2c3b516741b
Theme is 'Caught'. Start with Skellington 1.9.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
diff
changeset
|
7 import data |
f2c3b516741b
Theme is 'Caught'. Start with Skellington 1.9.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
diff
changeset
|
8 |
17 | 9 import pygame |
10 from pygame.locals import SWSURFACE, SRCALPHA | |
11 from albow.dialogs import alert | |
12 from albow.shell import Shell | |
13 from menu import MenuScreen | |
24
9d5de13e2ac3
Add a game screen. So far, the game content looks a *lot* like the main menu.
Jeremy Thurgood <firxen@gmail.com>
parents:
20
diff
changeset
|
14 from gamescreen import GameScreen |
20 | 15 from constants import SCREEN |
17 | 16 |
17 class MainShell(Shell): | |
18 def __init__(self, display): | |
19 Shell.__init__(self, display) | |
20 self.menu_screen = MenuScreen(self) | |
24
9d5de13e2ac3
Add a game screen. So far, the game content looks a *lot* like the main menu.
Jeremy Thurgood <firxen@gmail.com>
parents:
20
diff
changeset
|
21 self.game_screen = GameScreen(self) |
17 | 22 self.show_screen(self.menu_screen) |
23 | |
0
f2c3b516741b
Theme is 'Caught'. Start with Skellington 1.9.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
diff
changeset
|
24 def main(): |
25
f9e697e0c6ba
Don't initialise the entire pygame
Stefano Rivera <stefano@rivera.za.net>
parents:
24
diff
changeset
|
25 pygame.display.init() |
f9e697e0c6ba
Don't initialise the entire pygame
Stefano Rivera <stefano@rivera.za.net>
parents:
24
diff
changeset
|
26 pygame.font.init() |
20 | 27 display = pygame.display.set_mode(SCREEN) |
17 | 28 shell = MainShell(display) |
29 shell.run() | |
30 |