Add a rock for lighthouses.
authorSimon Cross <hodgestar@gmail.com>
Sat, 10 Sep 2016 23:39:05 +0000 (01:39 +0200)
committerSimon Cross <hodgestar@gmail.com>
Sat, 10 Sep 2016 23:39:05 +0000 (01:39 +0200)
data/stations/03-lighthouse.json
misc/hexagon.py [new file with mode: 0644]

index 7b1d5c1558ab87eff0baeee9ba9584fbb0a334f4..212d4ac3ecd19699a0360f3277a7a3115b1bef45 100644 (file)
     }
   ],
   "obstacles": [
     }
   ],
   "obstacles": [
+    {
+      "type": "wall",
+      "vertices": [
+        [532, 352], [522, 369], [502, 369], [492, 352], [502, 335], [522, 335]
+      ]
+    }
   ],
   "lights": [
   ]
   ],
   "lights": [
   ]
diff --git a/misc/hexagon.py b/misc/hexagon.py
new file mode 100644 (file)
index 0000000..87bfa23
--- /dev/null
@@ -0,0 +1,13 @@
+import json
+
+import pymunk
+
+r = 20
+radial = pymunk.Vec2d(r, 0)
+centre = pymunk.Vec2d(512, 352)
+
+vertices = []
+for d in range(0, 360, 60):
+    vertices.append(centre + radial.rotated_degrees(d))
+
+print json.dumps([[int(round(v.x)), int(round(v.y))] for v in vertices])