draw tile at board coordinates tilex and tileyoptionally few pixels over (determined by adjx and adjy lefttop getlefttopoftile(tilextiley pygame draw rect(displaysurftilecolor(left adjxtop adjytilesizetilesize) textsurf basicfont render(str(number)truetextcolor textrect textsurf get_rect( textrect center left int(tilesize adjxtop int(tilesize adjy displaysurf blit(textsurftextrectthe drawtile(function will draw single numbered tile on the board the tilex and tiley parameters are the board coordinates of the tile the number parameter is string of the tile' number (like ' or ' 'the adjx and adjy keyword parameters are for making minor adjustments to the position of the tile for examplepassing for adjx would make the tile appear pixels to the right of the tilex and tiley space on the board passing - for adjx would make the tile appear pixels to the left of the space these adjustment values will be handy when we need to draw the tile in the middle of sliding if no values are passed for these arguments when drawtile(is calledthen by default they are set to this means they will be exactly on the board space given by tilex and tiley the pygame drawing functions only use pixel coordinatesso first line converts the board coordinates in tilex and tiley to pixel coordinateswhich we will store in variables left and top (since getlefttopoftile(returns the top left corner' coordinateswe draw the background square of the tile with call to pygame draw rect(while adding the adjx and adjy values to left and top in case the code needs to adjust the position of the tile lines to then create the surface object that has the number text drawn on it rect object for the surface object is positionedand then used to blit the surface object to the display surface the drawtile(function doesn' call pygame display update(functionsince the caller of drawtile(probably will want to draw more tiles for the rest of the board before making them appear on the screen the making text appear on the screen def maketext(textcolorbgcolortopleft) create the surface and rect objects for some text textsurf basicfont render(texttruecolorbgcolor textrect textsurf get_rect( textrect topleft (topleft return (textsurftextrectemail questions to the authoral@inventwithpython com