projects
/
naja.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
24597ee
)
Add quitting.
author
Simon Cross
<hodgestar@gmail.com>
Sun, 11 May 2014 16:04:07 +0000
(18:04 +0200)
committer
Simon Cross
<hodgestar@gmail.com>
Sun, 11 May 2014 16:04:28 +0000
(18:04 +0200)
naja/scenes/menu.py
patch
|
blob
|
history
diff --git
a/naja/scenes/menu.py
b/naja/scenes/menu.py
index c1fd5f814513eddab54e345c9671b8dc312c9425..822c87a1eb77db35d98b965694c3aff81e7b4dae 100644
(file)
--- a/
naja/scenes/menu.py
+++ b/
naja/scenes/menu.py
@@
-2,8
+2,11
@@
Main menu scene.
"""
+import pygame.locals as pgl
+
from naja.scenes.scene import Scene
from naja.widgets.text import TextWidget
+from naja.events import QuitGameEvent
class MenuScene(Scene):
@@
-14,4
+17,6
@@
class MenuScene(Scene):
colour=(255, 255, 255)))
def handle_event(self, ev):
- pass
+ if ev.type == pgl.KEYUP and ev.key in (pgl.K_q, pgl.K_ESCAPE):
+ QuitGameEvent.post()
+ return