def __init__(self, width, height): bar_h_1 = Bar() bar_h_2 = Bar() bar_v_1 = Bar() bar_v_2 = Bar() self.width = width self.height = height self.margin = MARGIN self.barWidth = BARWIDTH self.itemSize = ITEMSIZE self.buttonWidth = BUTTONWIDTH self.buttonHeight = BUTTONHEIGHT self.board_arr = [[CHECKER_EMPTY for i in range(NUM_ROWS)] for j in range(NUM_COLS)] rotate = pygame.transform.rotate scale = pygame.transform.scale bar_h_1.image = rotate(bar_h_1.image, 90) bar_h_2.image = rotate(bar_h_2.image, 90) bar_h_1.image = scale(bar_h_1.image, ((int(width - 2 * self.margin)), self.barWidth)) bar_h_2.image = scale(bar_h_2.image, ((int(width - 2 * self.margin)), self.barWidth)) bar_v_1.image = scale(bar_v_1.image, (self.barWidth, (int(width - 2 * self.margin)))) bar_v_2.image = scale(bar_v_2.image, (self.barWidth, (int(width - 2 * self.margin)))) bar_h_1.rect.midtop = (self.margin, self.margin + self.itemSize + 0.5 * self.barWidth) bar_h_2.rect.midtop = (self.margin, self.margin + 2 * self.itemSize + 1.5 * self.barWidth) bar_v_1.rect.midtop = (self.margin + self.itemSize + 0.5 * self.barWidth, self.margin) bar_v_2.rect.midtop = (self.margin + 2 * self.itemSize + 1.5 * self.barWidth, self.margin) self.bar_h_1 = bar_h_1 self.bar_h_2 = bar_h_2 self.bar_v_1 = bar_v_1 self.bar_v_2 = bar_v_2 btn_player_first = Button('player') btn_ai_first = Button('AI') btn_player_first.rect.midtop = (self.width - self.margin - self.buttonWidth, self.height - 3 * self.margin - self.buttonHeight) btn_ai_first.rect.midtop = (2 * self.margin, self.height - 3 * self.margin - self.buttonHeight) self.btn_player_first = btn_player_first self.btn_ai_first = btn_ai_first self.prompt = False