From 6244a2832f953244d4938729d84026064f56e20f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Szuszert?= Date: Thu, 28 Apr 2022 18:34:54 +0200 Subject: [PATCH] =?UTF-8?q?wyb=C3=B3r=20punktu=20w=20A*?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tiles.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tiles.py b/tiles.py index 0564140..b6d6098 100644 --- a/tiles.py +++ b/tiles.py @@ -344,7 +344,6 @@ def astar(map, start, end): continue open_list.append(child) - map = Map() waiter = Waiter([32, 32]) tables = [] @@ -363,7 +362,6 @@ for i in range(16): for table in tables: map.add_table(table.loc) - def main(): direction = [] while True: @@ -393,9 +391,11 @@ def main(): left, middle, right = pygame.mouse.get_pressed() if left: waiterGo(mouseToNum()) - elif right: - goal = (18, 18) + x = pygame.mouse.get_pos()[1] + y = pygame.mouse.get_pos()[0] + goal = (x//32, y//32) + #goal = (18,18) route = astar(map.get_arr(), (waiter.loc[1] // 32, waiter.loc[0] // 32), goal) direction = [(x[1] - y[1], x[0] - y[0]) for x, y in zip(route[1:], route)] if len(direction) > 0: