the blank space' coordinates come from call to getblankposition(from these coordinates and the direction of the slidewe can figure out the xy board coordinates of the tile that will slide these coordinates will be stored in the movex and movey variables the copy(surface method prepare the base surface drawboard(boardmessage basesurf displaysurf copy( draw blank space over the moving tile on the basesurf surface moveleftmovetop getlefttopoftile(movexmovey pygame draw rect(basesurfbgcolor(moveleftmovetoptilesizetilesize)the copy(method of surface objects will return new surface object that has the same image drawn to it but they are two separate surface objects after calling the copy(methodif we draw on one surface object using blit(or the pygame drawing functionsit will not change the image on the other surface object we store this copy in the basesurf variable on line nextwe paint another blank space over the tile that will slide this is because when we draw each frame of the sliding animationwe will draw the sliding tile over different parts of the basesurf surface object if we didn' blank out the moving tile on the basesurf surfacethen it would still be there as we draw the sliding tile in that casehere is what the basesurf surface would look likeand then what it would look like when we draw the -- |tile sliding upwards on top of it