points is list of dicts that tells fillboardandanimate( where on the screen to display text to show how many points the player got points is list because if the player gets multiple matchesthen multiple points text should appear points [ for gemset in matchedgems scoreadd +( (len(gemset for gem in gemset gameboard[gem[ ]][gem[ ]empty_space points append({'points'scoreadd ' 'gem[ gemimagesize xmargin ' 'gem[ gemimagesize ymargin} random choice(gamesounds['match']play( score +scoreadd drop the new gems fillboardandanimate(gameboardpointsscore check if there are any new matches matchedgems findmatchinggems(gameboard firstselectedgem none if not canmakemove(gameboard) gameisover true draw the board displaysurf fill(bgcolor drawboard(gameboard if firstselectedgem !none highlightspace(firstselectedgem[' ']firstselectedgem[' '] if gameisover if clickcontinuetextsurf =none only render the text once in future iterationsjust use the surface object already in clickcontinuetextsurf clickcontinuetextsurf basicfont render('final score% (click to continue)(score) gameovercolorgameoverbgcolor clickcontinuetextrect clickcontinuetextsurf get_rect( clickcontinuetextrect center int(windowwidth )int(windowheight displaysurf blit(clickcontinuetextsurfclickcontinuetextrect elif score and time time(lastscorededuction deductspeed score drops over time email questions to the authoral@inventwithpython com