After dying, the Game Over screen is shown, which then awaits for the user to press a key to continue the game. Since the screen is shown immediately after death, the user could still press a key to move the snake, and not to continue the game. To fix that I tried putting a call to pygame.time.wait there, but that does not seem to work.
Remove the current solution and add another one, that really prevents missclicking after snake's death.
After dying, the Game Over screen is shown, which then awaits for the user to press a key to continue the game. Since the screen is shown immediately after death, the user could still press a key to move the snake, and not to continue the game. To fix that I tried putting a call to pygame.time.wait there, but that does not seem to work. Remove the current solution and add another one, that really prevents missclicking after snake's death.