Mercurial > pyntnclick
annotate gamelib/main.py @ 24:9d5de13e2ac3
Add a game screen. So far, the game content looks a *lot* like the main menu.
author | Jeremy Thurgood <firxen@gmail.com> |
---|---|
date | Sun, 22 Aug 2010 18:09:25 +0200 |
parents | 177e3a7825e8 |
children | f9e697e0c6ba |
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(): |
17 | 25 pygame.init() |
20 | 26 display = pygame.display.set_mode(SCREEN) |
17 | 27 shell = MainShell(display) |
28 shell.run() | |
29 |