AI_PRO/drawUI.py
2021-03-28 22:42:36 +02:00

29 lines
951 B
Python

from Main.constants import *
import pygame
def makeField(board, display):
color = BLACK
for i in range(int(HORIZONTAL_TILES_NUMBER)):
for j in range(int(VERTICAL_TILES_NUMBER)):
field = board[i][j]
if field.state == 0:
color = WHITE
elif field.state == 1:
color = RED
elif field.state == 2:
color = YELLOW
elif field.state == 3:
color = GREEN
elif field.state == 4:
color = BLACK
pygame.draw.rect(display, color,
[i * TILE_SIZE, j * TILE_SIZE, TILE_SIZE, TILE_SIZE])
def drawTractor(board, display, tractor_horizontal_index, tractor_vertical_index):
pygame.draw.rect(display, BLACK,
[tractor_horizontal_index * TILE_SIZE, tractor_vertical_index * TILE_SIZE, TRACTOR_WIDTH,
TRACTOR_HEIGHT])