lastfalltime time time(lastmovedowntime time time(lastmovesidewaystime time time(if the player has pressed the keythen the game should pause we need to hide the board from the player (otherwise the player could cheat by pausing the game and taking time to decide where to move the piecethe code blanks out the display surface with call to displaysurf fill(bgcolorand stops the music the showtextscreen(function is called to display the --paused|text and wait for the player to press key to continue once the player has pressed keyshowtextscreen(will return line will restart the background music alsosince large amount of time could have passed since the player paused the gamethe lastfalltimelastmovedowntimeand lastmovesidewaystime variables should all be reset to the current time (which is done on lines to using movement variables to handle user input elif (event key =k_left or event key =k_a)movingleft false elif (event key =k_right or event key =k_d)movingright false elif (event key =k_down or event key =k_s)movingdown false letting up on one of the arrow keys (or the wasd keyswill set the movingleftmovingrightor movingdown variables back to falseindicating that the player no longer wants to move the piece in those directions the code later will handle what to do based on the boolean values inside these --moving|variables note that the up arrow and keys are used for rotating the piecenot moving the piece up this is why there is no movingup variable checking if slide or rotation is valid elif event type =keydown moving the block sideways if (event key =k_left or event key =k_aand isvalidposition(boardfallingpieceadjx=- ) fallingpiece[' '- movingleft true movingright false lastmovesidewaystime time time(