annotate gamelib/main.py @ 53:655a6912e0ae

Split gui stuff out of main.py
author Neil Muller <drnlmuller@gmail.com>
date Mon, 07 May 2012 22:10:26 +0200
parents 1d3d20bdc8b9
children a253fae32a6f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
d0de8832774b Import skellington-1.9 into the repo
Neil Muller <drnlmuller+bitbucket@gmail.com>
parents:
diff changeset
1 '''Game main module.
d0de8832774b Import skellington-1.9 into the repo
Neil Muller <drnlmuller+bitbucket@gmail.com>
parents:
diff changeset
2
d0de8832774b Import skellington-1.9 into the repo
Neil Muller <drnlmuller+bitbucket@gmail.com>
parents:
diff changeset
3 Contains the entry point used by the run_game.py script.
d0de8832774b Import skellington-1.9 into the repo
Neil Muller <drnlmuller+bitbucket@gmail.com>
parents:
diff changeset
4
d0de8832774b Import skellington-1.9 into the repo
Neil Muller <drnlmuller+bitbucket@gmail.com>
parents:
diff changeset
5 Feel free to put all your game code here, or in other modules in this "gamelib"
d0de8832774b Import skellington-1.9 into the repo
Neil Muller <drnlmuller+bitbucket@gmail.com>
parents:
diff changeset
6 package.
d0de8832774b Import skellington-1.9 into the repo
Neil Muller <drnlmuller+bitbucket@gmail.com>
parents:
diff changeset
7 '''
37
9c4bf1f15431 gui stuff
Rizmari Versfeld <rizziepit@gmail.com>
parents: 1
diff changeset
8 import pygame
0
d0de8832774b Import skellington-1.9 into the repo
Neil Muller <drnlmuller+bitbucket@gmail.com>
parents:
diff changeset
9
53
655a6912e0ae Split gui stuff out of main.py
Neil Muller <drnlmuller@gmail.com>
parents: 52
diff changeset
10 from gamelib.engine import Engine
655a6912e0ae Split gui stuff out of main.py
Neil Muller <drnlmuller@gmail.com>
parents: 52
diff changeset
11 from gamelib.mainmenu import MainMenu
52
1d3d20bdc8b9 Move engine stuff into it's own file
Neil Muller <drnlmuller@gmail.com>
parents: 51
diff changeset
12
53
655a6912e0ae Split gui stuff out of main.py
Neil Muller <drnlmuller@gmail.com>
parents: 52
diff changeset
13 from gamelib.constants import SCREEN
0
d0de8832774b Import skellington-1.9 into the repo
Neil Muller <drnlmuller+bitbucket@gmail.com>
parents:
diff changeset
14
1
c90a6586cd66 PEP8-ify skellington (because)
Neil Muller <drnlmuller@gmail.com>
parents: 0
diff changeset
15
37
9c4bf1f15431 gui stuff
Rizmari Versfeld <rizziepit@gmail.com>
parents: 1
diff changeset
16 pygame.init()
9c4bf1f15431 gui stuff
Rizmari Versfeld <rizziepit@gmail.com>
parents: 1
diff changeset
17
51
ac637e84f8f8 Consilidate engine stuff and eventify window stack manipulation
Neil Muller <drnlmuller@gmail.com>
parents: 48
diff changeset
18
0
d0de8832774b Import skellington-1.9 into the repo
Neil Muller <drnlmuller+bitbucket@gmail.com>
parents:
diff changeset
19 def main():
48
a2980cc9a060 Factor out some constants
Neil Muller <drnlmuller@gmail.com>
parents: 44
diff changeset
20 screen = pygame.display.set_mode(SCREEN)
51
ac637e84f8f8 Consilidate engine stuff and eventify window stack manipulation
Neil Muller <drnlmuller@gmail.com>
parents: 48
diff changeset
21 engine = Engine(screen)
ac637e84f8f8 Consilidate engine stuff and eventify window stack manipulation
Neil Muller <drnlmuller@gmail.com>
parents: 48
diff changeset
22 window = MainMenu(screen)
ac637e84f8f8 Consilidate engine stuff and eventify window stack manipulation
Neil Muller <drnlmuller@gmail.com>
parents: 48
diff changeset
23 engine.run(window)