Exemple #1
0
            if start_button.active:
                start = start_button.set_pos(graph1, posx - centered_w,
                                             posy - centered_h)
            start_button.check_pressed(posx, posy)

            if end_button.active:
                end = end_button.set_pos(graph1, posx - centered_w,
                                         posy - centered_h)
            end_button.check_pressed(posx, posy)

            if restart_button.check_pressed(posx, posy):
                once = True
                start = None
                end = None
                start_button.active = False
                end_button.active = False
                display.blit(maze_img, (centered_w, centered_h))
                surf.fill((255, 255, 255, 0))

    # Update the algorithm drop down list
    algo_drop_down_selected = algo_drop_down.update(events)
    if algo_drop_down_selected != -1:
        algo_drop_down.update_list(algo_drop_down_selected)

    # Update the selected maze drop down list
    maze_drop_down_selected = maze_drop_down.update(events)
    if maze_drop_down_selected != -1:
        maze_drop_down.update_list(maze_drop_down_selected)

        # Check the selected option