I'm trying to make a day/night feature for my game where every 10 minutes the background changes, but when I run it it just crashes on startup. Here's the buggy code.
bg = pygame.image.load("bg.png")
bgg = pygame.image.load("bbg.png")
def bg1():
screen.blit(bg, (0, 0))
def bbg1():
screen.blit(bbg, (0, 0))
def fbg():
bg1()
pygame.time.wait(10000)
bbg1()
screen.fill((0,0,0))
fbg()
I have the screen.fill((0,0,0)) because there is a rect there as well which moves around.