ix setting up timing constants for holding down keys more setup code setting up the piece templates splitting --line of code|across multiple lines the main(function the start of new game the game loop the event handling loop pausing the game using movement variables to handle user input checking if slide or rotation is valid finding the bottom moving by holding down the key letting the piece --naturally|fall drawing everything on the screen maketextobjs() shortcut function for making text the same old terminate(function waiting for key press event with the checkforkeypress(function showtextscreen() generic text screen function the checkforquit(function the calculatelevelandfallfreq(function generating pieces with the getnewpiece(function adding pieces to the board data structure creating new board data structure the isonboard(and isvalidposition(functions checking forand removingcomplete lines convert from board coordinates to pixel coordinates drawing box on the board or elsewhere on the screen drawing everything to the screen