Mercurial > rinkhals
comparison gamelib/mainmenu.py @ 11:5d58a5b13731
Extremely rudimentary game engine.
author | Simon Cross <hodgestar@gmail.com> |
---|---|
date | Sun, 30 Aug 2009 15:11:44 +0000 |
parents | 99c4f2226314 |
children | 69fd96eafde8 |
comparison
equal
deleted
inserted
replaced
10:0ecf1e3ab087 | 11:5d58a5b13731 |
---|---|
1 """Main menu.""" | 1 """Main menu.""" |
2 | 2 |
3 from pgu import gui | 3 from pgu import gui |
4 import pygame | 4 import pygame |
5 import constants | 5 import constants |
6 import engine | |
6 | 7 |
7 class MainMenu(gui.Table): | 8 class MainMenu(gui.Table): |
8 def __init__(self, **params): | 9 def __init__(self, **params): |
9 gui.Table.__init__(self, **params) | 10 gui.Table.__init__(self, **params) |
10 | 11 |
11 def fullscreen_toggled(): | 12 def fullscreen_toggled(): |
12 pygame.display.toggle_fullscreen() | 13 pygame.display.toggle_fullscreen() |
13 | 14 |
14 def quit_pressed(): | 15 def quit_pressed(): |
15 pygame.event.post(pygame.event.Event(pygame.QUIT)) | 16 pygame.event.post(engine.QUIT) |
16 | 17 |
17 def start_pressed(): | 18 def start_pressed(): |
18 pygame.event.post(pygame.event.Event(pygame.USEREVENT, event="<Our Start Event Class>")) | 19 pygame.event.post(engine.START_DAY) |
19 | 20 |
20 start_button = gui.Button("Start") | 21 start_button = gui.Button("Start") |
21 start_button.connect(gui.CLICK, start_pressed) | 22 start_button.connect(gui.CLICK, start_pressed) |
22 | 23 |
23 quit_button = gui.Button("Quit") | 24 quit_button = gui.Button("Quit") |