From: adrianna Date: Sat, 10 Sep 2016 13:48:48 +0000 (+0200) Subject: added exit button X-Git-Tag: tabakrolletjie-v1.0.0~97^2~4 X-Git-Url: https://git.ctpug.org.za/?a=commitdiff_plain;h=7505b6b20a0143d60e32cc415321f323d69372b2;p=tabakrolletjie.git added exit button --- diff --git a/data/images/32/exit.png b/data/images/32/exit.png new file mode 100644 index 0000000..fd81d05 Binary files /dev/null and b/data/images/32/exit.png differ diff --git a/data/images/Makefile b/data/images/Makefile index b72c050..7319c75 100644 --- a/data/images/Makefile +++ b/data/images/Makefile @@ -6,7 +6,7 @@ MOULD_BODY=mouldA mouldB mouldC MOULD=eyeballA eyeballB eyeballC LIGHT=spotlight lamp laser LIGHT_MASK=light_mask_2_1 light_mask_2_2 light_mask_3_1 light_mask_3_2 light_mask_3_3 -CONTROLS=night default_cursor +CONTROLS=night default_cursor exit IMG16=$(MOULD_BODY) IMG32=$(MOULD_BODY) $(MOULD) $(LIGHT) $(SEED) $(LIGHT_MASK) $(CONTROLS) diff --git a/sources/vector/exit.svg b/sources/vector/exit.svg new file mode 100644 index 0000000..7f09eeb --- /dev/null +++ b/sources/vector/exit.svg @@ -0,0 +1,84 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/tabakrolletjie/scenes/day.py b/tabakrolletjie/scenes/day.py index 57eeedb..4c81130 100644 --- a/tabakrolletjie/scenes/day.py +++ b/tabakrolletjie/scenes/day.py @@ -76,9 +76,10 @@ class DayScene(BaseScene): tools.append(tool) x += step - # TODO: will also add back to menu button tools.append(ImageButton( - '32', 'night.png', name='start night', pos=(SCREEN_SIZE[0] - 50, y))) + '32', 'night.png', name='start night', pos=(SCREEN_SIZE[0] - 100, y))) + tools.append(ImageButton( + '32', 'exit.png', name='exit', pos=(SCREEN_SIZE[0] - 50, y))) return tools def exit(self, gamestate): @@ -187,6 +188,9 @@ class DayScene(BaseScene): elif tool.name == 'start night': from .night import NightScene SceneChangeEvent.post(scene=NightScene()) + elif tool.name == 'exit': + from .menu import MenuScene + SceneChangeEvent.post(scene=MenuScene()) else: self._tool = tool if self._tool.name == 'seed':