import copy import pygame pygame.init() screen = pygame.display.set_mode((750,850)) pygame.display.set_caption("这是我自己做的五子棋") border_left = 25 #左边缘 border_right = 725 #右边缘 border_top = 25 #上边缘 border_bottom = 725 #下边缘 width = 50 #宽度 height = 50 #高度 border_right1 = 750 border_bottom1 = 750 map = [0]*16 for i in range(16): map[i] = [0]*16 player = 1 winner = 0 running = True font = pygame.font.SysFont('Simhei',24) class Button: def __init__(self,x,y,width,height,text,color,click_color,text_color) -> None: self.text = text self.color = color self.click_color = click_color self.text_color = text_color self.rect = pygame.Rect(x,y,width,height) self.clicked = False def draw(self,screen): if self.clicked: pygame.draw.rect(screen, self.click_color, self.rect) else: pygame.draw.rect(screen,self.color,self.rect) text_surface = font.render(self.text, True, self.text_color) text_rect = text_surface.get_rect(center = self.rect.center) screen.blit(text_surface, text_rect) def check(row,col): #判断左右方向是否五子连线 score = 1 for i
07-20
3098
11-10
4956