added button for skipping to day and documented it
authoradrianna <adrianna.pinska@gmail.com>
Sat, 10 Sep 2016 18:33:44 +0000 (20:33 +0200)
committeradrianna <adrianna.pinska@gmail.com>
Sat, 10 Sep 2016 18:33:44 +0000 (20:33 +0200)
data/images/32/day.png [new file with mode: 0644]
data/images/Makefile
sources/vector/day.svg [new file with mode: 0644]
tabakrolletjie/scenes/help.py
tabakrolletjie/scenes/night.py

diff --git a/data/images/32/day.png b/data/images/32/day.png
new file mode 100644 (file)
index 0000000..7301d50
Binary files /dev/null and b/data/images/32/day.png differ
index cc3a9a22861ce24e8960fbd72d714c87e3b0a51c..3b92dcb38e310dea268327ec26e35bc9a77ea977 100644 (file)
@@ -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 (file)
index 0000000..834615c
--- /dev/null
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="100mm"
+   height="100mm"
+   viewBox="0 0 354.33071 354.33071"
+   id="svg2"
+   version="1.1"
+   inkscape:version="0.91 r13725"
+   sodipodi:docname="day.svg">
+  <defs
+     id="defs4" />
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="1.4"
+     inkscape:cx="215.64212"
+     inkscape:cy="168.74492"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="true"
+     inkscape:window-width="1264"
+     inkscape:window-height="720"
+     inkscape:window-x="102"
+     inkscape:window-y="0"
+     inkscape:window-maximized="1"
+     inkscape:object-nodes="true"
+     inkscape:snap-smooth-nodes="true">
+    <inkscape:grid
+       type="xygrid"
+       id="grid4423"
+       units="mm"
+       spacingx="3.543307"
+       spacingy="3.543307" />
+  </sodipodi:namedview>
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(0,-698.0315)">
+    <path
+       sodipodi:type="star"
+       style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="path7027"
+       sodipodi:sides="16"
+       sodipodi:cx="177.16534"
+       sodipodi:cy="875.19684"
+       sodipodi:r1="159.44884"
+       sodipodi:r2="101.03444"
+       sodipodi:arg1="1.5707963"
+       sodipodi:arg2="1.7671458"
+       inkscape:flatsided="false"
+       inkscape:rounded="0"
+       inkscape:randomized="0"
+       d="m 177.16535,1034.6457 -19.71084,-60.35577 -41.30759,48.21847 4.8867,-63.30449 -56.615627,28.74029 28.740289,-56.61563 -63.304453,4.8867 48.218426,-41.30758 -60.355748,-19.71085 60.355745,-19.71084 -48.218427,-41.30759 63.30445,4.88671 -28.740288,-56.61563 56.615623,28.74029 -4.8867,-63.30446 41.30759,48.21843 19.71084,-60.35575 19.71084,60.35575 41.30759,-48.21843 -4.8867,63.30445 56.61563,-28.74029 -28.74029,56.61563 63.30445,-4.8867 -48.21843,41.30758 60.35575,19.71084 -60.35574,19.71084 48.21842,41.30759 -63.30445,-4.8867 28.74029,56.61563 -56.61562,-28.74029 4.8867,63.3045 -41.30759,-48.21847 z" />
+  </g>
+</svg>
index 0f6a94c87b8f1d3f86328598a987177e9a5a5bac..c58fea548eb8cc1dbcf77f6d17770ca6c12c140d 100644 (file)
@@ -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
 
index 803827665d534eb2627aef88dc47bb4d42a6d1a6..0c7688924e7ebd0d2e8e6fb245cab9fe1afabd8c 100644 (file)
@@ -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]