Made bugs round to match the round hitbox
authorJustin Worthe <justin@worthe-it.co.za>
Thu, 8 Mar 2018 21:15:42 +0000 (23:15 +0200)
committerJustin Worthe <justin@worthe-it.co.za>
Thu, 8 Mar 2018 21:15:42 +0000 (23:15 +0200)
src/entities/bug.rs
src_assets/sprites/Bug.png
src_assets/sprites/Bug.svg

index d2d5c2e..424e195 100644 (file)
@@ -37,8 +37,6 @@ impl Bug {
     }
 
     fn touches(&self, point: Vec2d) -> bool {
-        let rx = 35.;
-        let ry = 16.;
-        self.pos.distance(point) <= 45. // Some better hit box modelling might be nice?
+        self.pos.distance(point) <= 75. // Some better hit box modelling might be nice?
     }
 }
index 8110555..43337cc 100644 (file)
Binary files a/src_assets/sprites/Bug.png and b/src_assets/sprites/Bug.png differ
index c060ba2..0570569 100644 (file)
@@ -9,13 +9,13 @@
    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="400"
+   width="200"
    height="200"
-   viewBox="0 0 105.83333 52.916668"
+   viewBox="0 0 52.916665 52.916668"
    version="1.1"
    id="svg8"
    inkscape:version="0.92.2 5c3e80d, 2017-08-06"
-   sodipodi:docname="bug.svg"
+   sodipodi:docname="Bug.svg"
    inkscape:export-filename="/home/justin/proj/bug_basher/src_assets/sprites/bug.png"
    inkscape:export-xdpi="48"
    inkscape:export-ydpi="48">
      borderopacity="1.0"
      inkscape:pageopacity="0.0"
      inkscape:pageshadow="2"
-     inkscape:zoom="1.4"
-     inkscape:cx="170.45361"
-     inkscape:cy="213.89051"
+     inkscape:zoom="2.8"
+     inkscape:cx="47.256073"
+     inkscape:cy="137.77672"
      inkscape:document-units="mm"
      inkscape:current-layer="layer1"
      showgrid="false"
      units="px"
-     inkscape:window-width="1920"
-     inkscape:window-height="1026"
+     inkscape:window-width="1916"
+     inkscape:window-height="1055"
      inkscape:window-x="0"
-     inkscape:window-y="27"
-     inkscape:window-maximized="1" />
+     inkscape:window-y="21"
+     inkscape:window-maximized="0" />
   <metadata
      id="metadata5">
     <rdf:RDF>
      transform="translate(0,-244.08332)">
     <path
        style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.32291663;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
-       d="m 48.002975,285.84968 c 6.614583,7.93751 8.693452,7.55953 18.709823,8.1265"
+       d="m 31.655505,284.43227 c 4.157738,4.81921 1.133928,5.95313 11.622769,9.35492"
        id="path1390"
        inkscape:connector-curvature="0"
        sodipodi:nodetypes="cc" />
     <path
-       style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.32291667;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
-       d="m 23.056547,285.09374 c 0,0 -1.511904,7.9375 -17.7648804,7.37053"
+       style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.32291663;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       d="m 14.835565,283.86532 c 0,0 1.251351,3.82724 -9.0959857,10.69681"
        id="path1386"
-       inkscape:connector-curvature="0" />
-    <path
-       style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.32291667;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
-       d="m 32.883927,286.41665 c 0,0 -3.401785,9.44941 -15.497022,7.74851"
-       id="path1388"
-       inkscape:connector-curvature="0" />
+       inkscape:connector-curvature="0"
+       sodipodi:nodetypes="cc" />
     <path
-       style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.32291667;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
-       d="m 64.633927,284.33778 c 0,0 5.669645,7.37054 14.930061,7.74852"
+       style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.32291663;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       d="m 25.70238,287.64507 c 0,0 -1.417409,2.26786 0.755954,8.59897"
        id="path1392"
-       inkscape:connector-curvature="0" />
+       inkscape:connector-curvature="0"
+       sodipodi:nodetypes="cc" />
     <path
-       style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.32291667;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
-       d="M 22.489583,258.82439 C 1.3229166,250.13094 0.94494047,258.06844 0.94494047,258.06844"
+       style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.32291663;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       d="M 15.875001,259.01337 C 6.7952262,248.42448 6.7952262,248.42448 6.7952262,248.42448"
        id="path1378"
-       inkscape:connector-curvature="0" />
+       inkscape:connector-curvature="0"
+       sodipodi:nodetypes="cc" />
     <path
        style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.32291663;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
-       d="M 35.907739,256.74552 13.040178,247.67409"
-       id="path1380"
-       inkscape:connector-curvature="0" />
-    <path
-       style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.32291667;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
-       d="m 52.53869,256.17856 c 0,0 9.827382,-8.69345 20.032737,-8.69345"
+       d="m 25.040922,253.06026 c 0,0 0.755954,-5.57515 3.307291,-8.40997"
        id="path1382"
-       inkscape:connector-curvature="0" />
+       inkscape:connector-curvature="0"
+       sodipodi:nodetypes="cc" />
     <path
-       style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.32291667;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
-       d="m 68.41369,259.95832 c 0,0 4.346726,-7.55952 15.308035,-7.55952"
+       style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.32291663;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       d="m 34.301339,255.61158 c 0,0 -0.566965,-5.29166 9.82738,-6.70907"
        id="path1384"
-       inkscape:connector-curvature="0" />
-    <ellipse
-       style="opacity:1;fill:#00a70e;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.32291667;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:normal"
+       inkscape:connector-curvature="0"
+       sodipodi:nodetypes="cc" />
+    <circle
+       style="opacity:1;fill:#00a70e;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.21835673;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:normal"
        id="path1370"
-       cx="43.845238"
-       cy="271.95905"
-       rx="35.71875"
-       ry="15.969494" />
+       cy="270.54166"
+       cx="26.458334"
+       r="19.234571" />
     <circle
-       style="opacity:1;fill:#00d10e;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.32291667;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:normal"
+       style="opacity:1;fill:#00d10e;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.32291663;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:normal"
        id="path1368"
-       cx="86.178574"
-       cy="272.05356"
+       cx="41.2939"
+       cy="269.69119"
        r="10.961308" />
     <path
-       style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.32291667;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
-       d="m 89.958332,277.53421 c 0,0 10.205358,-1.70089 3.212797,12.09524"
+       style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.32291663;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       d="m 43.750743,275.73882 c 0,0 10.205358,-1.70089 3.212797,12.09524"
        id="path1394"
        inkscape:connector-curvature="0"
        sodipodi:nodetypes="cc" />
     <path
-       style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.32291667;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
-       d="m 90.714284,268.08481 c 0,0 10.205356,-3.77976 3.779764,-11.71726"
+       style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.32291663;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       d="m 43.561754,263.17112 c 0,0 10.205356,-3.77976 3.779764,-11.71726"
        id="path1396"
        inkscape:connector-curvature="0"
        sodipodi:nodetypes="cc" />
     <circle
        style="opacity:1;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1.32291663;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:normal"
        id="path1398"
-       cx="94.312737"
-       cy="255.74025"
+       cx="48.105148"
+       cy="251.11005"
        r="3.0401909" />
     <circle
        style="opacity:1;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1.32291663;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:normal"
        id="path1398-3"
-       cx="92.87616"
-       cy="289.78372"
+       cx="46.196098"
+       cy="288.17731"
        r="3.0401909"
        inkscape:transform-center-x="0.20045215"
        inkscape:transform-center-y="-17.639789" />