I have a title screen loop, that takes the title screen and slowly fades it out. It's copied directly from another program of mine, in which it works like a charm. But it just doesn't work here. It delays correctly, but the image on the screen doesn't change. Any ideas?
titlescreen.set_alpha(255)
title_alpha_value = 255
screen.blit(titlescreen, (0, 0))
pygame.display.flip()
while not past_title:
for event in pygame.event.get():
if event.type == pygame.QUIT:
sys.exit('Thanks for playing!')
elif event.type == pygame.KEYDOWN or event.type == pygame.MOUSEBUTTONDOWN:
while titlescreen.get_alpha() >= 1:
title_alpha_value -= 5
screen.fill(128, 128, 128)
titlescreen.set_alpha(title_alpha_value)
screen.blit(titlescreen, (0, 0))
pygame.display.flip()
pygame.time.delay(1)
past_title = True
break