From: adrianna Date: Sat, 10 Sep 2016 18:33:44 +0000 (+0200) Subject: added button for skipping to day and documented it X-Git-Tag: tabakrolletjie-v1.0.0~53^2~3 X-Git-Url: https://git.ctpug.org.za/?p=tabakrolletjie.git;a=commitdiff_plain;h=c8191a153de7d9354c781b915e6aa3c41c5fc94b added button for skipping to day and documented it --- diff --git a/data/images/32/day.png b/data/images/32/day.png new file mode 100644 index 0000000..7301d50 Binary files /dev/null and b/data/images/32/day.png differ diff --git a/data/images/Makefile b/data/images/Makefile index cc3a9a2..3b92dcb 100644 --- a/data/images/Makefile +++ b/data/images/Makefile @@ -6,7 +6,7 @@ MOULD_BODY=mouldA mouldB mouldC MOULD=eyeballA eyeballB eyeballC eyelid 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 exit pause play +CONTROLS=night default_cursor exit pause play day IMG16=$(MOULD_BODY) IMG32=$(MOULD_BODY) $(MOULD) $(LIGHT) $(SEED) $(LIGHT_MASK) $(CONTROLS) diff --git a/sources/vector/day.svg b/sources/vector/day.svg new file mode 100644 index 0000000..834615c --- /dev/null +++ b/sources/vector/day.svg @@ -0,0 +1,81 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/tabakrolletjie/scenes/help.py b/tabakrolletjie/scenes/help.py index 0f6a94c..c58fea5 100644 --- a/tabakrolletjie/scenes/help.py +++ b/tabakrolletjie/scenes/help.py @@ -90,6 +90,11 @@ class HelpScene(BaseScene): HelpItem(("32", "pause.png"), ( "You can pause the game during the night if you need to make a" " more detailed analysis of why you're losing horribly.")), + HelpItem(("32", "day.png"), ( + "If you have run out of turnips, you can click this button to" + " skip to the next day. Or you can keep playing with your lights." + " If you have no power left either, or you are completely" + " bankrupt, the night will end automatically.")), ] # Special mould assembly @@ -99,6 +104,9 @@ class HelpScene(BaseScene): items[1]._img.blit( loader.load_image("32", "eyeballA.png").convert_alpha(), (10, 10), None) + items[1]._img.blit( + loader.load_image("32", "eyelid.png").convert_alpha(), + (10, 10), None) return items diff --git a/tabakrolletjie/scenes/night.py b/tabakrolletjie/scenes/night.py index 8038276..0c76889 100644 --- a/tabakrolletjie/scenes/night.py +++ b/tabakrolletjie/scenes/night.py @@ -55,6 +55,11 @@ class NightScene(BaseScene): '32', 'exit.png', name='exit', pos=(SCREEN_SIZE[0] - 50, y))) return tools + def add_day_button(self): + y = SCREEN_SIZE[1] - 40 + self._tools.append(ImageButton( + '32', 'day.png', name='day', pos=(SCREEN_SIZE[0] - 200, y))) + @property def turnip_count(self): return len(self._turnips) @@ -116,6 +121,8 @@ class NightScene(BaseScene): elif tool.name == 'exit': from .menu import MenuScene SceneChangeEvent.post(scene=MenuScene()) + elif tool.name == 'day': + self._to_day() def toggle_pause(self): self._paused = not self._paused @@ -167,6 +174,9 @@ class NightScene(BaseScene): self._end_night() if not self._mould.alive(): self._end_night() + if not self.turnip_count: + self.add_day_button() + def exit(self, gamestate): turnip_data = [turnip.serialize() for turnip in self._turnips]