Double click the flag so it doesn't glitch. When you lose or when you win double click the flag to play again.
Credit to myself for the entire project.