Projekt_AI-Automatyczny_saper/Engine/Board.py
2021-03-15 19:58:20 +01:00

17 lines
566 B
Python

import pygame
from Constants import ROWS, COLS, SQUARE_SIZE, GREEN, BLACK, WIDTH
class Board:
def __init__(self):
self.board = []
def drawSquares(self, win):
win.fill(GREEN)
for row in range(ROWS):
for col in range(COLS):
pygame.draw.rect(win, BLACK, pygame.Rect(row * SQUARE_SIZE, col * SQUARE_SIZE, SQUARE_SIZE, SQUARE_SIZE), 2)
def drawAgent(self, win, agent):
dis = WIDTH // ROWS
pygame.draw.rect(win, self.color, (agent.row * dis + 1, agent.column * dis + 1, dis - 2, dis - 2))