From: Simon Cross Date: Sun, 11 Sep 2016 00:00:25 +0000 (+0200) Subject: Merge branch 'master' of ctpug.org.za:tabakrolletjie X-Git-Tag: tabakrolletjie-v1.0.0~13 X-Git-Url: https://git.ctpug.org.za/?p=tabakrolletjie.git;a=commitdiff_plain;h=eaba54e95ab4dbfd54a4001b116fe1679a30661e;hp=cf16332db2124643be0febdc3a2c15c94b82506d Merge branch 'master' of ctpug.org.za:tabakrolletjie --- diff --git a/data/stations/05-spiral.json b/data/stations/05-spiral.json new file mode 100644 index 0000000..718856f --- /dev/null +++ b/data/stations/05-spiral.json @@ -0,0 +1,36 @@ +{ + "config": { + "name": "Stachybotrys", + "spawn positions": [[25, 400], [1000, 410], [500, 25], [510, 690]], + "seeds": 100, + "turnip target": 10 + }, + "battery": { + "current": 4000, + "max": 4000, + "recharge": 4000 + }, + "available_lights": [ + { + "type": "pulsatinglamp", + "cost": 3, + "available_colours": ["red/blue", "blue/green"], + "intensity": 0.5, + "radius_limits": [20, 400] + } + ], + "obstacles": [ + { + "type": "shrub", + "shrublets": [ + [517, 401, 40], [528, 423, 40], [503, 449, 40], [453, 442, 40], + [418, 384, 40], [445, 304, 40], [536, 262, 40], [645, 307, 40], + [694, 432, 40], [631, 570, 40], [472, 627, 40], [305, 545, 40], + [241, 352, 40], [341, 156, 40], [568, 85, 40], [793, 204, 40], + [871, 463, 40] + ] + } + ], + "lights": [ + ] +} diff --git a/misc/spiral.py b/misc/spiral.py new file mode 100644 index 0000000..6280ddc --- /dev/null +++ b/misc/spiral.py @@ -0,0 +1,20 @@ +import math +import json + +import pymunk + + +def make_shrub(centre, radial, degrees): + radial = radial * (degrees / 80.) + c = centre + radial.rotated_degrees(degrees) + return [int(round(c.x)), int(round(c.y)), 40] + + +radial = pymunk.Vec2d(40, 0) +centre = pymunk.Vec2d(512, 400) + +obstacles = [] +for d in range(10, 810, 45): + obstacles.append(make_shrub(centre, radial, d)) + +print json.dumps(obstacles)