0

I'm coding a game and I want to put cycling backgrounds that fade when they change. I did some code but images change without fading, what can I do? everything is inside while main_menu: and every main_menu cycle is executed one time every tick (set as 60)

    #change background when tics (60 per second) are over 1200
    nframe += 1
    while nframe > 1200:
        nframe = 0
        countbackgrounds += 1
        if countbackgrounds == len(backgrounds) #backgrounds tuple contain all backgrounds images:
            countbackgrounds = 0
.
.
.

    #menu spawn
    menu = backgrounds[countbackgrounds]
    menu = pygame.transform.scale(menu, (ROOTwidth, ROOTheight))
    ROOT.blit(menu, [0,0])

0 Answers0