From c8191a153de7d9354c781b915e6aa3c41c5fc94b Mon Sep 17 00:00:00 2001 From: adrianna Date: Sat, 10 Sep 2016 20:33:44 +0200 Subject: [PATCH] added button for skipping to day and documented it --- data/images/32/day.png | Bin 0 -> 1258 bytes data/images/Makefile | 2 +- sources/vector/day.svg | 81 +++++++++++++++++++++++++++++++++ tabakrolletjie/scenes/help.py | 8 ++++ tabakrolletjie/scenes/night.py | 10 ++++ 5 files changed, 100 insertions(+), 1 deletion(-) create mode 100644 data/images/32/day.png create mode 100644 sources/vector/day.svg diff --git a/data/images/32/day.png b/data/images/32/day.png new file mode 100644 index 0000000000000000000000000000000000000000..7301d508de9c04a859267140f6daf2d65ca2b1c6 GIT binary patch literal 1258 zcmVO@i5HgQdwDh?)D zGy#K$9(vIT%c3+Cm#tVm2tq;+PDP;s>tUg2S-SL~QUie=+C!m8yV&-kSae!H(wU4V zshz~lmroB%iuGe1qpb9I8lHLI=lQ?S%>3VX0RGQtwc1-+t@hSsa=avUph~6cI7PsH ztyX(q%GgT_peX9Y=H}+{qcNRM_ohy#`%eczl7f@1C!VM1(-!&SI9{>O- z6pGsphl6rB95tn-rMCe9j7DSc(9qC5xm?am&HM6cL6RhEGMUWNXf*nJHWrV^V-AO- zm}S|I;_>(@Ns{ljwY9wl0HD+9?vW%}(%s!X(%IQb_6!X!7#%3ikH)RwW6@ zWHL`HDk^?ZsZ`%DEiF9=hr?ThyUH#avoKMRFIf9L1t0|0%rFeI6^TU9X0tuIQ1PsKhGDi45o56!dORL3 z6bj*aghCk|{qW;3(6xEMx6OsCVxaU2SQkaGtFK|qeMANUxvfOLmV9)U9GLHwVzh&gcB+hiUze>{a!R0 zJ>YrChIS?##{tW-2TG-~Q=w2a9KU}906;F6*HIMpeqCMNTTZ95)^4{GS(CXclF1|l z0s%1)2>iCTw)V@$#>NE8vcF2+3tkusg`$C`>1mhCwS3g=awQlHqRZu4rfGWmv`28F z1G~GsPdJWyOb~=jrBYpbL29)c%FD}Tf*{QA?(RN0cfz%PhSy<4H?kL}S#dZVPIh&5 zb>(Ws9*>8cot>SP%jNl!toS%DVlz7PGnC0>We$gfE-WmBcsveXua_4D;at&zAb{8F z<>T=<6ciLddwaVzr|tM!42yB!`~A`EvAnpr*s!p$ z@YnqO{60YtdVpug^0~RWNJmGFewJskgWH$D=Wm$u!o~)by>? zym?XwCK8Fgm6erGkH(6Mirx-~!y%Ss7qYRPot*n`oikVQb9(Lk0~lbe U<>K+&?EnA(07*qoM6N<$f<}W*J^%m! literal 0 HcmV?d00001 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] -- 2.34.1