displaysurf blit(origsurf( ) def drawbuttons() pygame draw rect(displaysurfyellowyellowrect pygame draw rect(displaysurfbluebluerect pygame draw rect(displaysurfredredrect pygame draw rect(displaysurfgreengreenrect def changebackgroundanimation(animationspeed= ) global bgcolor newbgcolor (random randint( )random randint( )random randint( ) newbgsurf pygame surface((windowwidthwindowheight) newbgsurf newbgsurf convert_alpha( rgb newbgcolor for alpha in range( animationspeed)animation loop checkforquit( displaysurf fill(bgcolor newbgsurf fill((rgbalpha) displaysurf blit(newbgsurf( ) drawbuttons(redraw the buttons on top of the tint pygame display update( fpsclock tick(fps bgcolor newbgcolor def gameoveranimation(color=whiteanimationspeed= ) play all beeps at oncethen flash the background origsurf displaysurf copy( flashsurf pygame surface(displaysurf get_size() flashsurf flashsurf convert_alpha( beep play(play all four beeps at the same timeroughly beep play( beep play( beep play( rgb color for in range( )do the flash times for startendstep in (( )( - )) the first iteration in this loop sets the following for loop to go from to the second from to