From 55fc32f12843b2ffab00b85846ec0e793e40aed4 Mon Sep 17 00:00:00 2001 From: adrianna Date: Sat, 10 Sep 2016 16:54:05 +0200 Subject: [PATCH] add exit to night --- tabakrolletjie/scenes/night.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tabakrolletjie/scenes/night.py b/tabakrolletjie/scenes/night.py index e3b51cb..3f58d92 100644 --- a/tabakrolletjie/scenes/night.py +++ b/tabakrolletjie/scenes/night.py @@ -42,8 +42,11 @@ class NightScene(BaseScene): def create_tools(self, gamestate): tools = [] + y = SCREEN_SIZE[1] - 40 tools.append(ImageButton( - '32', 'pause.png', name='pause play', pos=(SCREEN_SIZE[0] - 150, SCREEN_SIZE[1] - 40))) + '32', 'pause.png', name='pause play', pos=(SCREEN_SIZE[0] - 150, y))) + tools.append(ImageButton( + '32', 'exit.png', name='exit', pos=(SCREEN_SIZE[0] - 50, y))) return tools @debug_timer("night.render") @@ -96,6 +99,9 @@ class NightScene(BaseScene): if tool.pressed(ev): if tool.name == 'pause play': self.toggle_pause() + elif tool.name == 'exit': + from .menu import MenuScene + SceneChangeEvent.post(scene=MenuScene()) def toggle_pause(self): self._paused = not self._paused -- 2.34.1