drawstatus(scoreleveldrawnextpiece(nextpieceif fallingpiece !nonedrawpiece(fallingpiecepygame display update(fpsclock tick(fpsnow that the game loop has handled all events and updated the game statethe game loop just needs to draw the game state to the screen most of the drawing is handled by other functionsso the game loop code just needs to call those functions then the call to pygame display update(makes the display surface appear on the actual computer screenand the tick(method call adds slight pause so the game doesn' run too fast maketextobjs() shortcut function for making text def maketextobjs(textfontcolor) surf font render(texttruecolor return surfsurf get_rect(the maketextobjs(function just provides us with shortcut given the textfont objectand color objectit calls render(for us and returns the surface and rect object for this text this just saves us from typing out the code to create the surface and rect object each time we need them the same old terminate(function def terminate() pygame quit( sys exit(the terminate(function works the same as in the previous game programs waiting for key press event with the checkforkeypress(function def checkforkeypress() go through event queue looking for keyup event grab keydown events to remove them from the event queue checkforquit( for event in pygame event get([keydownkeyup]) if event type =keydown