import pygame, sys import tractor,pathfinding,field,ui from pygame.locals import * pole = field.field() path = pathfinding.pathfinding() traktor = tractor.tractor(pole) UI = ui.game_ui(traktor,pole) pygame.init() UI.update() UI.update() while True: for event in pygame.event.get(): if event.type == QUIT: print("Zamykanie...") pygame.quit() sys.exit() elif event.type == KEYDOWN: key = pygame.key.get_pressed() if key[K_d]: traktor.move_right() if key[K_s]: traktor.move_down() if key[K_a]: traktor.move_left() if key[K_w]: traktor.move_up() if key[K_SPACE]: traktor.work() if key[K_1]: traktor.set_mode(0) if key[K_2]: traktor.set_mode(1) if key[K_3]: traktor.set_mode(2) if key[K_4]: traktor.set_mode(3) if key[K_p]: path.pathfinding(traktor,pole,UI) if key[K_F10]: print(traktor.get_poz()) if key[K_F11]: print(traktor.get_field_value()) UI.update() UI.update()