Mercurial > boomslang
annotate gamelib/main.py @ 26:0a68d137f509
Initial inventory palette thing.
author | Jeremy Thurgood <firxen@gmail.com> |
---|---|
date | Sun, 22 Aug 2010 18:38:56 +0200 |
parents | f9e697e0c6ba |
children | 0f25f7b9b37a |
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 |
17 | 7 import pygame |
8 from pygame.locals import SWSURFACE, SRCALPHA | |
9 from albow.dialogs import alert | |
10 from albow.shell import Shell | |
26
0a68d137f509
Initial inventory palette thing.
Jeremy Thurgood <firxen@gmail.com>
parents:
25
diff
changeset
|
11 |
0a68d137f509
Initial inventory palette thing.
Jeremy Thurgood <firxen@gmail.com>
parents:
25
diff
changeset
|
12 import data |
17 | 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 |