I'm trying to make tic tac toe with pygame. If you click in any one of the squares, an x will be displayed. The problem is that it takes a lot of clicks to display the x. here's the code:
while True:
for event in pygame.event.get():
if event == pygame.QUIT:
pygame.quit()
sys.exit()
mouse_pos = pygame.mouse.get_pos()
event = pygame.event.wait()
screen.fill(bg_color)
if event.type == pygame.MOUSEBUTTONDOWN and 250 < mouse_pos[0] < 300 and 250 > mouse_pos[1] > 199:
mouse_clicked1 = True
if event.type == pygame.MOUSEBUTTONDOWN and 301 < mouse_pos[0] < 351 and 249 > mouse_pos[1] > 201:
mouse_clicked2 = True
if mouse_clicked1:
screen.blit(x, object_top_left)
if mouse_clicked2:
screen.blit(x, object_top)