diff --git a/App.py b/App.py index d3c0a73..be9f2d5 100644 --- a/App.py +++ b/App.py @@ -21,7 +21,7 @@ pole.draw_grid() #musi byc tutaj wywołane ponieważ inicjalizuje sloty do slown ui=Ui.Ui(screen) #Tractor creation traktor_slot = pole.get_slot_from_cord((0, 0)) -traktor = Tractor.Tractor(traktor_slot, screen, Osprzet.plug,clock) +traktor = Tractor.Tractor(traktor_slot, screen, Osprzet.opryskiwacz,clock) def init_demo(): #Demo purpose @@ -37,8 +37,12 @@ def init_demo(): #Demo purpose ui.render_text_to_console(string_to_print="Przejazd inicjalizujacy- traktor sprawdza poziom nawodnienia") traktor.initial_move(pole) traktor.reset_pos(pole) + bfsRoot = Tractor.BFS({"x": 0, "y": 0, "direction": "E", "hydradeIndex": traktor.slot_hydrate_dict}) + bfsRoot.reverse() + # ui.render_text_to_console(string_to_print="traktor porusza się ścieżką bfs") + traktor.move_by_root(bfsRoot, pole, [traktor.irrigateSlot]) start_flag=False - demo_move() + # demo_move() old_info=get_info(old_info) for event in pygame.event.get(): if event.type == pygame.QUIT: diff --git a/Pole.py b/Pole.py index f2c6f4d..983dbf9 100644 --- a/Pole.py +++ b/Pole.py @@ -55,8 +55,8 @@ class Pole: def check_collision(self,mouse_x,mouse_y): mouse_x=math.floor(mouse_x/dCon.CUBE_SIZE) mouse_y=math.floor(mouse_y/dCon.CUBE_SIZE) - if(mouse_x<20): - if(mouse_y<12): + if(mouse_x