pygame draw rect(displaysurfbgcolor(xmargintopmarginboxsize boardwidthboxsize boardheight) draw the individual boxes on the board for in range(boardwidth) for in range(boardheight) drawbox(xyboard[ ][ ] def drawstatus(scorelevel) draw the score text scoresurf basicfont render('score%sscoretruetextcolor scorerect scoresurf get_rect( scorerect topleft (windowwidth displaysurf blit(scoresurfscorerect draw the level text levelsurf basicfont render('level%sleveltruetextcolor levelrect levelsurf get_rect( levelrect topleft (windowwidth displaysurf blit(levelsurflevelrect def drawpiece(piecepixelx=nonepixely=none) shapetodraw shapes[piece['shape']][piece['rotation'] if pixelx =none and pixely =none if pixelx pixely hasn' been specifieduse the location stored in the piece data structure pixelxpixely converttopixelcoords(piece[' ']piece[' '] draw each of the blocks that make up the piece for in range(templatewidth) for in range(templateheight) if shapetodraw[ ][ !blank drawbox(nonenonepiece['color']pixelx ( boxsize)pixely ( boxsize) def drawnextpiece(piece) draw the "nexttext nextsurf basicfont render('next:'truetextcolor nextrect nextsurf get_rect( nextrect topleft (windowwidth displaysurf blit(nextsurfnextrect draw the "nextpiece drawpiece(piecepixelx=windowwidth- pixely=