AI_PROJECT/Slot.py

21 lines
779 B
Python
Raw Normal View History

2024-03-10 15:03:56 +01:00
import pygame
import displayControler as dCon
2024-03-10 15:03:56 +01:00
BLACK=(0,0,0)
BORDER_COLOR=BLACK
BORDER_THICKNESS=1 #Has to be INT value
class Slot:
def __init__(self,x_axis,y_axis,color,screen): #TODO crop and related to it things handling. for now as a place holder crop=>color
self.x_axis=x_axis
self.y_axis=y_axis
self.color=color
self.screen=screen
self.field=pygame.Rect(self.x_axis*dCon.CUBE_SIZE,self.y_axis*dCon.CUBE_SIZE,dCon.CUBE_SIZE,dCon.CUBE_SIZE)
2024-03-10 15:03:56 +01:00
def draw(self):
pygame.draw.rect(self.screen,self.color,self.field,0) #Draw field
pygame.draw.rect(self.screen,BLACK,self.field,BORDER_THICKNESS) #Draw border
pygame.display.update()
def color_change(self,color):
self.color=color
self.draw()