Beispiel #1
0
 def __init__(self, win, arr):
     pygame.init()
     self.win = win
     self.set = Settings()
     self.arr = arr
     self.printr = Printr(self.win, self.set)
     self.c1 = self.set.light_grey
     self.c2 = self.set.light_blue
Beispiel #2
0
 def __init__(self, win):
     pygame.init()
     super().__init__()
     self.win = win
     self.printr = Printr(self.win, self.set)
     self.show_centroid = False
     self.c0 = self.set.grey
     self.c1 = self.set.light_grey  ## Arr coord's
     self.c2 = self.set.light_blue  ## Pixel coords
Beispiel #3
0
    def __init__(self, win):
        pygame.init()
        self.win = win
        self.printr = Printr(self.win)
        self.set = Settings()

        self.c1 = self.set.ultra_light_grey
        self.c2 = self.set.grey
        self.c3 = self.set.dark_grey
Beispiel #4
0
    def __init__(self, win, pixels):
        pygame.init()
        self.win = win
        self.printr = Printr(self.win)
        self.set = Settings()

        self.pixels = pixels

        self.c0 = self.set.grey
        self.c1 = self.set.light_grey
        self.c2 = self.set.ultra_light_grey
Beispiel #5
0
    def __init__(self):
        pygame.init()
        super().__init__()

        self.win_w, self.win_h  = 1900, 950
        self.win = pygame.display.set_mode((self.win_w, self.win_h), pygame.RESIZABLE)
        self.printr = Printr(self.win)

        self.nodes = []
        self.queue = []

        self.algo_wait = False

        ## Object flags
        self.hover_node = False
        self.edge_start_node = False
        self.algo_start_node = False
        self.algo_end_node = False
Beispiel #6
0
    def __init__(self, win):
        super().__init__()
        pygame.init()
        self.win = win
        self.printr = Printr(self.win, self.set)
        self.drawline = DrawLine(self.win, self.arr)
        self.show_intercepts = False

        ## Agnostic units
        self.degrees = 30
        self.slope = 1

        ## Pixel units
        self.pixel_mid = [800, 400]
        self.pixel_length = self.pixel_w / 2 + 10
        self.update_end_points()

        ## Array units
        self.arr_start = (1, 1)
        self.arr_mid = (1, 1)
        self.y_intercept = 1
        self.update_RSS()
Beispiel #7
0
    def __init__(self, win):
        super().__init__()
        pygame.init()
        self.win = win
        self.printr = Printr(self.win)

        self.draw = Draw(self.win, self.pixels)

        self.max_k = int(len(self.arr))
        self.k = self.init_k()

        ## Flags
        self.moving = False
        self.draw_outer_circle = False
        self.survived = True

        ### Circle ###
        self.pixel_mid = [800, 400]
        self.pixel_radius = 110

        #self.configure_draw()
        self.convert(True)  ## Initialize self.arr_mid