Variable Definitions : ending_num : it determines if the program should keep you in the gameplay or not(0 is playing and 1 is not playing and game over screen) mov : it moves the texts added to the screen to where they should be home_num : tells the program which screen it should be on
Problem : after the gameover screen apears the window becomes unresponsive and it says Not Responding When it becomes Not Responding And I have tried with the events and stuff and it didn't help.
if pygame.Rect.colliderect(ast1.objrect, jetrect) == True:
ending_num = 1
end_text = font1.render("Game Over : " + str(score), True, "red")
end_textrect = end_text.get_rect()
font2 = pygame.font.Font('freesansbold.ttf', 50)
text2 = font2.render("Home", True, "dark red", "white")
mov[1] = 80
text2rect = text2.get_rect()
text2rect = text2rect.move(mov)
font3 = pygame.font.Font('freesansbold.ttf', 50)
text3 = font3.render("Play", True, "dark red", "white")
mov[1] = 150
text3rect = text3.get_rect()
text3rect = text3rect.move(mov)
o_speed[1] = 0
screen.blit(background, backgroundrect)
screen.blit(end_text, end_textrect)
screen.blit(text2, text2rect)
screen.blit(text3, text3rect)
while True:
if 10 < mouse[0] < 149 and 80 < mouse[1] < 130 and pygame.mouse.get_pressed()[0]:
pygame.time.wait(70)
home_num = 0
ending_num = 0
break
if 10 < mouse[0] < 116 and 150 < mouse[1] < 200 and pygame.mouse.get_pressed()[0]:
pygame.time.wait(70)
home_num = 1
ending_num = 0
break
pygame.display.flip()