Reputation:
I'm trying to get an image in pygame to display after a collision is detected. But the problem I'm having is that the image only displays when the IF condition is true. Is there any way that I can get the image to stay if the condition is only true once?
Syntax /
#Game Over
if collision == True:
SCREEN.blit(start_menu, (0, 0))
SCREEN.blit(final_score, (800, 5))
NOTE: I already have a while statement and a for loop running under this program
Upvotes: 0
Views: 1862
Reputation: 1267
Here is a way:
Make a variable:
GameOver = False
Use the if statement you use to detect collision
if collision == True:
GameOver = True
Display your blit with this variable
if GameOver == True:
SCREEN.blit(start_menu, (0, 0))
SCREEN.blit(final_score, (800, 5))
Please tell me if this helped!
Upvotes: 1