(egg)
| 61 | |
| 62 | # Function to handle egg drop events |
| 63 | def egg_dropped(egg): |
| 64 | global lives_remaning |
| 65 | eggs.remove(egg) |
| 66 | c.delete(egg) |
| 67 | lose_a_life() |
| 68 | if lives_remaning == 0: |
| 69 | # Prompt the player to play again or exit |
| 70 | response = messagebox.askyesno('GAME OVER!', 'Final Score: ' + str(score) + '\nDo you want to play again?') |
| 71 | if response: |
| 72 | reset_game() # Reset the game if the player chooses to play again |
| 73 | else: |
| 74 | win.destroy() # Close the game if the player chooses not to play again |
| 75 | |
| 76 | # Function to reset the game state for a new game |
| 77 | def reset_game(): |
no test coverage detected