From: Simon Cross Date: Sat, 10 Sep 2016 23:39:05 +0000 (+0200) Subject: Add a rock for lighthouses. X-Git-Tag: tabakrolletjie-v1.0.0~17 X-Git-Url: https://git.ctpug.org.za/?a=commitdiff_plain;h=608201d3bcdf7012083167c3aa7c1a7bc731f665;p=tabakrolletjie.git Add a rock for lighthouses. --- diff --git a/data/stations/03-lighthouse.json b/data/stations/03-lighthouse.json index 7b1d5c1..212d4ac 100644 --- a/data/stations/03-lighthouse.json +++ b/data/stations/03-lighthouse.json @@ -23,6 +23,12 @@ } ], "obstacles": [ + { + "type": "wall", + "vertices": [ + [532, 352], [522, 369], [502, 369], [492, 352], [502, 335], [522, 335] + ] + } ], "lights": [ ] diff --git a/misc/hexagon.py b/misc/hexagon.py new file mode 100644 index 0000000..87bfa23 --- /dev/null +++ b/misc/hexagon.py @@ -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])