From 1e797f12e1130f04cd736d63e46efc81ed971ce3 Mon Sep 17 00:00:00 2001 From: Simon Cross Date: Sun, 11 May 2014 18:04:07 +0200 Subject: [PATCH] Add quitting. --- naja/scenes/menu.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/naja/scenes/menu.py b/naja/scenes/menu.py index c1fd5f8..822c87a 100644 --- 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 -- 2.34.1