Python
2
Вклад в тег
CELL_WIDTH = CELL_HEIGHT = 75
for p in [(x, y) for x in range(CELL_WIDTH, 610, CELL_WIDTH) for y in range(CELL_HEIGHT, 610, CELL_HEIGHT)]:
if (p[0] + p[1] ) % 2 == 0:
pygame.draw.rect(DISPLAY, WHITE_CELL, [X, Y, CELL_WIDTH, CELL_HEIGHT])
else:
pygame.draw.rect(DISPLAY, BLACK_CELL, [X, Y, CELL_WIDTH, CELL_HEIGHT])
if event.type == pygame.MOUSEBUTTONDOWN:
if event.button == 1:
if (X+75,Y) > event.pos > (X, Y):
print(X,Y)