elif scores[playertilescores[computertile] text 'you lost the computer beat you by % points (scores[computertilescores[playertile] else text 'the game was tie! textsurf font render(texttruetextcolortextbgcolor textrect textsurf get_rect( textrect center (int(windowwidth )int(windowheight ) displaysurf blit(textsurftextrect display the "play again?text with yes and no buttons text surf bigfont render('play again?'truetextcolortextbgcolor text rect text surf get_rect( text rect center (int(windowwidth )int(windowheight make "yesbutton yessurf bigfont render('yes'truetextcolortextbgcolor yesrect yessurf get_rect( yesrect center (int(windowwidth int(windowheight make "nobutton nosurf bigfont render('no'truetextcolortextbgcolor norect nosurf get_rect( norect center (int(windowwidth int(windowheight while true process events until the user clicks on yes or no checkforquit( for event in pygame event get()event handling loop if event type =mousebuttonup mousexmousey event pos if yesrect collidepoint(mousexmousey) return true elif norect collidepoint(mousexmousey) return false displaysurf blit(textsurftextrect displaysurf blit(text surftext rect displaysurf blit(yessurfyesrect displaysurf blit(nosurfnorect pygame display update( mainclock tick(fps