--- /dev/null
+""" Generate some tunnels and print them. """
+
+import json
+import sys
+
+replace = None
+if len(sys.argv) == 2:
+ replace = sys.argv[1]
+
+obstacle_defaults = {
+ "type": "wall",
+ "vertices": [],
+}
+
+w, h = 1024, 704
+cx, cy = int(w / 2), int(h / 2)
+gap_width = 88
+wall_width = 64
+block_width = gap_width + wall_width
+
+
+def make_wall(i, j):
+ wall = obstacle_defaults.copy()
+ top = cx - (gap_width / 2) + (i * block_width)
+ bottom = top - wall_width
+ left = cy + (gap_width / 2) + (j * block_width)
+ right = left + wall_width
+ wall["vertices"] = [
+ [left, top], [right, top], [right, bottom], [left, bottom],
+ ]
+ return wall
+
+walls = []
+
+for i in (-2, -1, 0, 1):
+ for j in (-2, -1, 0, 1, 2, 3):
+ walls.append(make_wall(i, j))
+
+if replace:
+ with open(replace, "r") as f:
+ station = json.load(f)
+ station["obstacles"] = walls
+ with open(replace, "w") as f:
+ json.dump(station, f, indent=2)
+else:
+ print json.dumps(walls, indent=2)