if icon1shape != icon2shape or icon1color != icon2color: # Icons don't match. Re-cover up both selections. pygame.time.wait(1000) # 1000 milliseconds = 1 sec coverBoxesAnimation(mainBoard, [(firstSelection, firstSelection), (boxx, boxy)]) revealedBoxes[firstSelection][firstSelection] = False revealedBoxes[boxx][boxy] = False
if statement on line 1  checks if either the shapes or colors of the two icons don’t match. If this is the case, then we want to pause the game for 1000 milliseconds (which is the same as 1 second) by calling
pygame.time.wait(1000) so that the player has a chance to see that the two icons don’t match. Then the "cover up" animation plays for both boxes. We also want to update the game state to mark these boxes as not revealed (that is, covered up).