I have to blink(on and off) 2 circles alternatively using pygame. How to make it blink using pygame.
for event in pygame.event.get():
blueball = pygame.draw.circle(screen, b, (175,100),20,3)
redball = pygame.draw.circle(screen, r, (675,350),20,3)
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_UP:
bluebally += 5
redballx +=5
if event.key == pygame.K_DOWN:
bluebally += 5
redballx +=5
if event.key == pygame.K_RIGHT:
blueballx += 5
redbally +=5
if event.key == pygame.K_RIGHT:
blueballx += 5
redbally +=5
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
screen.blit(blueball,(blueballx,bluebally))
screen.blit(redball,(redballx,redbally))
I expect blue ball and redball blink alternatively