AI_PRO/driving.py
2021-04-13 17:52:27 +02:00

31 lines
1.1 KiB
Python

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