from drawUI import * import pygame # def autodrive(tractor, direction, comeback): # if tractor.autodrive: # if not comeback: # if direction == "RIGHT" and tractor.horizontal_index == HORIZONTAL_TILES_NUMBER - 1: # direction = "DOWN" # elif direction == "DOWN" and tractor.horizontal_index == HORIZONTAL_TILES_NUMBER - 1: # direction = "LEFT" # elif direction == "LEFT" and tractor.horizontal_index == 0: # direction = "DOWN" # elif direction == "DOWN" and tractor.horizontal_index == 0: # direction = "RIGHT" # else: # direction = "UP" # return direction # # def isComebackTime(tractor, direction, comeback): # if tractor.vertical_index == 5 and tractor.horizontal_index == 0: # comeback = True # print(comeback) # direction = "UP" # if tractor.vertical_index == 0 and tractor.horizontal_index == 0: # comeback = False # print(comeback) # direction = "RIGHT" # return comeback, direction