From: adrianna Date: Sat, 10 Sep 2016 14:54:05 +0000 (+0200) Subject: add exit to night X-Git-Tag: tabakrolletjie-v1.0.0~86 X-Git-Url: https://git.ctpug.org.za/?a=commitdiff_plain;h=55fc32f12843b2ffab00b85846ec0e793e40aed4;p=tabakrolletjie.git add exit to night --- 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