From 608201d3bcdf7012083167c3aa7c1a7bc731f665 Mon Sep 17 00:00:00 2001 From: Simon Cross Date: Sun, 11 Sep 2016 01:39:05 +0200 Subject: [PATCH] Add a rock for lighthouses. --- data/stations/03-lighthouse.json | 6 ++++++ misc/hexagon.py | 13 +++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 misc/hexagon.py 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]) -- 2.34.1