Mercurial > mamba
annotate mamba/__main__.py @ 11:447311ee028c
Remove relative import.
author | Simon Cross <hodgestar@gmail.com> |
---|---|
date | Sun, 11 Sep 2011 13:05:26 +0200 |
parents | 6b9fa5e2fbc6 |
children | 0196455fa432 |
rev | line source |
---|---|
3
6b9fa5e2fbc6
Add initial window that does very little
Neil Muller <drnlmuller@gmail.com>
parents:
0
diff
changeset
|
1 """Main module for the game""" |
6b9fa5e2fbc6
Add initial window that does very little
Neil Muller <drnlmuller@gmail.com>
parents:
0
diff
changeset
|
2 |
6b9fa5e2fbc6
Add initial window that does very little
Neil Muller <drnlmuller@gmail.com>
parents:
0
diff
changeset
|
3 import sys |
6b9fa5e2fbc6
Add initial window that does very little
Neil Muller <drnlmuller@gmail.com>
parents:
0
diff
changeset
|
4 import os |
6b9fa5e2fbc6
Add initial window that does very little
Neil Muller <drnlmuller@gmail.com>
parents:
0
diff
changeset
|
5 import pygame |
6b9fa5e2fbc6
Add initial window that does very little
Neil Muller <drnlmuller@gmail.com>
parents:
0
diff
changeset
|
6 from pygame.locals import SWSURFACE |
6b9fa5e2fbc6
Add initial window that does very little
Neil Muller <drnlmuller@gmail.com>
parents:
0
diff
changeset
|
7 |
11 | 8 from mamba.constants import SCREEN |
3
6b9fa5e2fbc6
Add initial window that does very little
Neil Muller <drnlmuller@gmail.com>
parents:
0
diff
changeset
|
9 |
6b9fa5e2fbc6
Add initial window that does very little
Neil Muller <drnlmuller@gmail.com>
parents:
0
diff
changeset
|
10 # For future use |
6b9fa5e2fbc6
Add initial window that does very little
Neil Muller <drnlmuller@gmail.com>
parents:
0
diff
changeset
|
11 DEBUG = False |
6b9fa5e2fbc6
Add initial window that does very little
Neil Muller <drnlmuller@gmail.com>
parents:
0
diff
changeset
|
12 if os.environ.get('DEBUG'): |
6b9fa5e2fbc6
Add initial window that does very little
Neil Muller <drnlmuller@gmail.com>
parents:
0
diff
changeset
|
13 DEBUG = True |
6b9fa5e2fbc6
Add initial window that does very little
Neil Muller <drnlmuller@gmail.com>
parents:
0
diff
changeset
|
14 |
0 | 15 |
16 def main(): | |
3
6b9fa5e2fbc6
Add initial window that does very little
Neil Muller <drnlmuller@gmail.com>
parents:
0
diff
changeset
|
17 """Launch the currently unnamed mamab game""" |
6b9fa5e2fbc6
Add initial window that does very little
Neil Muller <drnlmuller@gmail.com>
parents:
0
diff
changeset
|
18 |
6b9fa5e2fbc6
Add initial window that does very little
Neil Muller <drnlmuller@gmail.com>
parents:
0
diff
changeset
|
19 pygame.display.init() |
6b9fa5e2fbc6
Add initial window that does very little
Neil Muller <drnlmuller@gmail.com>
parents:
0
diff
changeset
|
20 pygame.font.init() |
6b9fa5e2fbc6
Add initial window that does very little
Neil Muller <drnlmuller@gmail.com>
parents:
0
diff
changeset
|
21 # TODO: Sound initialisation |
6b9fa5e2fbc6
Add initial window that does very little
Neil Muller <drnlmuller@gmail.com>
parents:
0
diff
changeset
|
22 pygame.display.set_mode(SCREEN, SWSURFACE) |
6b9fa5e2fbc6
Add initial window that does very little
Neil Muller <drnlmuller@gmail.com>
parents:
0
diff
changeset
|
23 pygame.display.set_caption('Mamba') |
6b9fa5e2fbc6
Add initial window that does very little
Neil Muller <drnlmuller@gmail.com>
parents:
0
diff
changeset
|
24 |
6b9fa5e2fbc6
Add initial window that does very little
Neil Muller <drnlmuller@gmail.com>
parents:
0
diff
changeset
|
25 # Placeholder to do something for some time |
6b9fa5e2fbc6
Add initial window that does very little
Neil Muller <drnlmuller@gmail.com>
parents:
0
diff
changeset
|
26 import time |
6b9fa5e2fbc6
Add initial window that does very little
Neil Muller <drnlmuller@gmail.com>
parents:
0
diff
changeset
|
27 time.sleep(2) |
6b9fa5e2fbc6
Add initial window that does very little
Neil Muller <drnlmuller@gmail.com>
parents:
0
diff
changeset
|
28 |
6b9fa5e2fbc6
Add initial window that does very little
Neil Muller <drnlmuller@gmail.com>
parents:
0
diff
changeset
|
29 |
6b9fa5e2fbc6
Add initial window that does very little
Neil Muller <drnlmuller@gmail.com>
parents:
0
diff
changeset
|
30 |