forked from s452751/AI_PRO
29 lines
951 B
Python
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])
|