コード例 #1
0
ファイル: main.py プロジェクト: lemonad/voronoi-maze
        points.append(
            Vector2(
                x * X_DELTA + gauss(0, X_SD) + x_offset,
                y * Y_DELTA + gauss(0, Y_SD) + y_offset,
            ))

# Instead place points by uniform random sampling?
if False:
    points = []
    for i in range(N_X * N_Y):
        x = randint(0, 1000)
        y = randint(0, 900)
        points.append(Vector2(x, y))

voronoi = VoronoiDiagram(points)
start_ix = voronoi.create_maze()


def main():
    draw_points = False
    draw_triangulation = False
    draw_circumcircles1 = False
    draw_circumcircles2 = False
    draw_voronoi_cells = False
    draw_voronoi_connections = True
    draw_maze_edges = True

    pygame.init()
    screen = pygame.display.set_mode((WIDTH, HEIGHT))

    s = pygame.Surface(screen.get_size(), pygame.SRCALPHA, 32)