Merge branch 'master' of ctpug.org.za:koperkapel
authorSimon Cross <hodgestar@gmail.com>
Wed, 2 Mar 2016 21:29:59 +0000 (23:29 +0200)
committerSimon Cross <hodgestar@gmail.com>
Wed, 2 Mar 2016 21:29:59 +0000 (23:29 +0200)
koperkapel/images/roach_management/eject_button.png [new file with mode: 0644]
koperkapel/images/roach_management/inventory_pad.png
koperkapel/images/roach_management/left_button.png [new file with mode: 0644]
koperkapel/images/roach_management/right_button.png [new file with mode: 0644]
koperkapel/images/vehicles/walking/background.png [new file with mode: 0644]
koperkapel/scenes/roaches.py
sources/vector/roach_management/eject_button.svg [new file with mode: 0644]
sources/vector/roach_management/inventory_pad.svg
sources/vector/roach_management/left_button.svg [new file with mode: 0644]
sources/vector/roach_management/right_button.svg [new file with mode: 0644]
sources/vector/vehicles/walking/background.svg [new file with mode: 0644]

diff --git a/koperkapel/images/roach_management/eject_button.png b/koperkapel/images/roach_management/eject_button.png
new file mode 100644 (file)
index 0000000..39c6af8
Binary files /dev/null and b/koperkapel/images/roach_management/eject_button.png differ
index e141684b89aa05a67abc50961dd05d8960a72bdf..72c038280faf1b7d0c4ba1e9f9b51b2292f84e0e 100644 (file)
Binary files a/koperkapel/images/roach_management/inventory_pad.png and b/koperkapel/images/roach_management/inventory_pad.png differ
diff --git a/koperkapel/images/roach_management/left_button.png b/koperkapel/images/roach_management/left_button.png
new file mode 100644 (file)
index 0000000..80b86ba
Binary files /dev/null and b/koperkapel/images/roach_management/left_button.png differ
diff --git a/koperkapel/images/roach_management/right_button.png b/koperkapel/images/roach_management/right_button.png
new file mode 100644 (file)
index 0000000..8408526
Binary files /dev/null and b/koperkapel/images/roach_management/right_button.png differ
diff --git a/koperkapel/images/vehicles/walking/background.png b/koperkapel/images/vehicles/walking/background.png
new file mode 100644 (file)
index 0000000..f93e586
Binary files /dev/null and b/koperkapel/images/vehicles/walking/background.png differ
index 09169f3ac80bd4566933c8dd97b50303fc110144..b5c2715e126e2db4268a27418d716cf1b1f323ca 100644 (file)
@@ -7,6 +7,18 @@ from ..constants import WIDTH, HEIGHT
 from .base import Scene, ChangeSceneEvent
 
 
+TOOLBAR_LEFT_X = WIDTH * 3 // 4
+TOOLBAR_TOP_Y = 0
+TOOLBAR_MID_Y = HEIGHT * 1 // 2
+BUTTON_INSET = (20, 20)
+
+
+def inset_button(pos, dx, dy):
+    return (
+        pos[0] + dx * BUTTON_INSET[0],
+        pos[1] + dy * BUTTON_INSET[1])
+
+
 class RoachesScene(Scene):
     """ Roach management scene. """
 
@@ -15,15 +27,47 @@ class RoachesScene(Scene):
         self._roach_actors = {}
         self._roaches = self.actors.add_layer("roaches", level=10)
         self._pads = self.actors.add_layer("pads", level=5)
+        self._buttons = self.actors.add_layer("buttons", level=6)
+        self._init_bg()
         self._init_pads()
+        self._init_buttons()
+
+    def _init_bg(self):
+        self.actors.default.add(Actor("vehicles/walking/background"))
 
     def _init_pads(self):
         self._roach_pad = self._pads.add(
-            Actor("roach_management/roach_pad"))
-        self._roach_pad.pos = (WIDTH * (7/8), HEIGHT * (1/4))
+            Actor("roach_management/roach_pad", anchor=("left", "bottom")))
+        self._roach_pad.pos = (TOOLBAR_LEFT_X, TOOLBAR_MID_Y)
         self._inventory_pad = self._pads.add(
-            Actor("roach_management/inventory_pad"))
-        self._inventory_pad.pos = (WIDTH * (7/8), HEIGHT * (3/4))
+            Actor("roach_management/inventory_pad", anchor=("left", "top")))
+        self._inventory_pad.pos = (TOOLBAR_LEFT_X, TOOLBAR_MID_Y)
+
+    def _init_buttons(self):
+        self._roach_left = self._buttons.add(
+            Actor("roach_management/left_button", anchor=("left", "bottom")))
+        self._roach_left.pos = inset_button(
+            self._roach_pad.bottomleft, 1, -1)
+
+        self._roach_right = self._buttons.add(
+            Actor("roach_management/right_button", anchor=("right", "bottom")))
+        self._roach_right.pos = inset_button(
+            self._roach_pad.bottomright, -1, -1)
+
+        self._inventory_left = self._buttons.add(
+            Actor("roach_management/left_button", anchor=("left", "bottom")))
+        self._inventory_left.pos = inset_button(
+            self._inventory_pad.bottomleft, 1, -1)
+
+        self._inventory_right = self._buttons.add(
+            Actor("roach_management/right_button", anchor=("right", "bottom")))
+        self._inventory_right.pos = inset_button(
+            self._inventory_pad.bottomright, -1, -1)
+
+        self._road_eject = self._buttons.add(
+            Actor("roach_management/eject_button", anchor=("right", "top")))
+        self._road_eject.pos = inset_button(
+            (TOOLBAR_LEFT_X, TOOLBAR_TOP_Y), -1, 1)
 
     def update(self, world, dt):
         for i, roach in enumerate(world.roaches):
diff --git a/sources/vector/roach_management/eject_button.svg b/sources/vector/roach_management/eject_button.svg
new file mode 100644 (file)
index 0000000..172f5bc
--- /dev/null
@@ -0,0 +1,94 @@
+<?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="64"
+   height="128"
+   viewBox="0 0 64.000001 128"
+   id="svg3397"
+   version="1.1"
+   inkscape:version="0.91 r13725"
+   sodipodi:docname="eject_button.svg">
+  <defs
+     id="defs3399" />
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="2.467796"
+     inkscape:cx="-69.378208"
+     inkscape:cy="54.810268"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="false"
+     units="px"
+     inkscape:window-width="1231"
+     inkscape:window-height="776"
+     inkscape:window-x="49"
+     inkscape:window-y="24"
+     inkscape:window-maximized="1" />
+  <metadata
+     id="metadata3402">
+    <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,-924.36216)">
+    <flowRoot
+       xml:space="preserve"
+       id="flowRoot3405"
+       style="font-style:normal;font-weight:normal;font-size:22.5px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       transform="translate(0,924.36216)"><flowRegion
+         id="flowRegion3407"><rect
+           id="rect3409"
+           width="57.946442"
+           height="40.927208"
+           x="2.0260994"
+           y="4.8131585" /></flowRegion><flowPara
+         id="flowPara3411"
+         style="font-size:15px;-inkscape-font-specification:'DejaVu Sans Bold';font-family:'DejaVu Sans';font-weight:bold;font-style:normal;font-stretch:normal;font-variant:normal;text-anchor:middle;text-align:center">Eject</flowPara><flowPara
+         id="flowPara3413"
+         style="font-size:15px;-inkscape-font-specification:'DejaVu Sans Bold';font-family:'DejaVu Sans';font-weight:bold;font-style:normal;font-stretch:normal;font-variant:normal;text-anchor:middle;text-align:center">Roach</flowPara></flowRoot>    <path
+       sodipodi:type="star"
+       style="fill:#ffe685;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;opacity:0"
+       id="path3415"
+       sodipodi:sides="5"
+       sodipodi:cx="8.9148369"
+       sodipodi:cy="986.71654"
+       sodipodi:r1="16.707644"
+       sodipodi:r2="8.3538218"
+       sodipodi:arg1="0.24497866"
+       sodipodi:arg2="0.87329719"
+       inkscape:flatsided="false"
+       inkscape:rounded="0"
+       inkscape:randomized="0"
+       d="m 25.123632,990.76875 -10.843111,2.3506 -4.210761,10.26485 -5.5862547,-9.58601 -11.0636817,-0.83264 7.39061575,-8.2751 -2.62697045,-10.77949 10.1539064,4.47175 9.4401247,-5.82944 -1.115156,11.03879 z"
+       inkscape:transform-center-x="-0.35689086"
+       inkscape:transform-center-y="1.2521983" />
+    <path
+       style="fill:#b68989;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;fill-opacity:1"
+       d="m 14.182695,979.42263 0,30.39147 22.692313,-12.15657 -2.43132,9.31997 18.640115,-17.82967 -19.855774,-14.9931 0,0 2.026099,8.9148 z"
+       id="path4217"
+       inkscape:connector-curvature="0" />
+  </g>
+</svg>
index c885b9d742ef9299b0ab7596ce41e0ca92a12397..e0ed03215e5eb16453c186797aed8c9ab9610709 100644 (file)
@@ -78,7 +78,7 @@
        xml:space="preserve"
        id="flowRoot3368"
        style="font-style:normal;font-weight:normal;font-size:22.5px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-       transform="translate(2.0018174,707.33604)"><flowRegion
+       transform="translate(2.0018174,647.33604)"><flowRegion
          id="flowRegion3370"><rect
            id="rect3372"
            width="205.85886"
diff --git a/sources/vector/roach_management/left_button.svg b/sources/vector/roach_management/left_button.svg
new file mode 100644 (file)
index 0000000..6b52e72
--- /dev/null
@@ -0,0 +1,63 @@
+<?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="32"
+   height="32"
+   viewBox="0 0 31.999999 31.999998"
+   id="svg4238"
+   version="1.1"
+   inkscape:version="0.91 r13725"
+   sodipodi:docname="left_button.svg">
+  <defs
+     id="defs4240" />
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="5.840214"
+     inkscape:cx="18.147302"
+     inkscape:cy="23.921443"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="false"
+     units="px"
+     inkscape:window-width="1231"
+     inkscape:window-height="776"
+     inkscape:window-x="49"
+     inkscape:window-y="24"
+     inkscape:window-maximized="1" />
+  <metadata
+     id="metadata4243">
+    <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,-1020.3622)">
+    <path
+       style="fill:#b68989;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.72720629px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="m 30.338139,1027.4204 0,22.1009 -16.501991,-8.8404 1.768071,6.7776 -13.5552085,-12.9659 14.4392425,-10.9031 0,0 -1.473391,6.4829 z"
+       id="path4217"
+       inkscape:connector-curvature="0" />
+  </g>
+</svg>
diff --git a/sources/vector/roach_management/right_button.svg b/sources/vector/roach_management/right_button.svg
new file mode 100644 (file)
index 0000000..898aabe
--- /dev/null
@@ -0,0 +1,63 @@
+<?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="32"
+   height="32"
+   viewBox="0 0 31.999999 31.999998"
+   id="svg4238"
+   version="1.1"
+   inkscape:version="0.91 r13725"
+   sodipodi:docname="right_button.svg">
+  <defs
+     id="defs4240" />
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="5.840214"
+     inkscape:cx="18.147302"
+     inkscape:cy="23.921443"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="false"
+     units="px"
+     inkscape:window-width="1231"
+     inkscape:window-height="776"
+     inkscape:window-x="49"
+     inkscape:window-y="24"
+     inkscape:window-maximized="1" />
+  <metadata
+     id="metadata4243">
+    <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,-1020.3622)">
+    <path
+       style="fill:#b68989;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.72720629px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="m 1.8524576,1027.4204 0,22.1009 16.5019914,-8.8404 -1.768071,6.7776 13.555208,-12.9659 -14.439242,-10.9031 0,0 1.473391,6.4829 z"
+       id="path4217"
+       inkscape:connector-curvature="0" />
+  </g>
+</svg>
diff --git a/sources/vector/vehicles/walking/background.svg b/sources/vector/vehicles/walking/background.svg
new file mode 100644 (file)
index 0000000..8f130b1
--- /dev/null
@@ -0,0 +1,99 @@
+<?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="1024"
+   height="768"
+   viewBox="0 0 1024 768.00001"
+   id="svg4299"
+   version="1.1"
+   inkscape:version="0.91 r13725"
+   sodipodi:docname="background.svg">
+  <defs
+     id="defs4301" />
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="0.79036458"
+     inkscape:cx="359.53871"
+     inkscape:cy="384"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="false"
+     units="px"
+     inkscape:window-width="1231"
+     inkscape:window-height="776"
+     inkscape:window-x="49"
+     inkscape:window-y="24"
+     inkscape:window-maximized="1"
+     inkscape:snap-global="true">
+    <sodipodi:guide
+       position="0,0"
+       orientation="0,1024"
+       id="guide4872" />
+    <sodipodi:guide
+       position="1024,0"
+       orientation="-768,0"
+       id="guide4874" />
+    <sodipodi:guide
+       position="1024,768.00001"
+       orientation="0,-1024"
+       id="guide4876" />
+    <sodipodi:guide
+       position="0,768.00001"
+       orientation="768,0"
+       id="guide4878" />
+  </sodipodi:namedview>
+  <metadata
+     id="metadata4304">
+    <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,-284.36216)">
+    <rect
+       style="opacity:0;fill:#d6c08f;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="rect4307"
+       width="948.60895"
+       height="692.89697"
+       x="37.944359"
+       y="319.87106" />
+    <rect
+       style="opacity:0;fill:#d6c08f;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="rect4849"
+       width="951.90851"
+       height="699.49603"
+       x="36.294601"
+       y="313.27203" />
+    <rect
+       style="opacity:1;fill:#d6c08f;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="rect4851"
+       width="1011.0013"
+       height="756.52222"
+       x="6.4993591"
+       y="290.10104"
+       rx="52.792126"
+       ry="52.792126" />
+  </g>
+</svg>