on is created on line to begin withthe entire surface object is painted to the background color on line draw the tile sprites onto this surface for in range(len(mapobj)) for in range(len(mapobj[ ])) spacerect pygame rect(( tilewidthy (tileheight tilefloorheight)tilewidthtileheight)the set of nested for loops on line and will go through every possible xy coordinate on the map and draw the appropriate tile image at that location if mapobj[ ][yin tilemappingbasetile tilemapping[mapobj[ ][ ]elif mapobj[ ][yin outsidedecomappingbasetile tilemapping['first draw the base ground/wall tile mapsurf blit(basetilespacerectthe basetile variable is set to the surface object of the tile image to be drawn at the iteration' current xy coordinate if the single-character string is in the outsidedecomapping dictionarythen tilemapping['(the single-character string for the basic outdoor floor tilewill be used if mapobj[ ][yin outsidedecomappingdraw any tree/rock decorations that are on this tile mapsurf blit(outsidedecomapping[mapobj[ ][ ]]spacerectadditionallyif the tile was listed in the outsidedecomapping dictionarythe corresponding tree or rock image should be drawn on top of the tile that was just drawn at that xy coordinate elif (xyin gamestateobj['stars']if (xyin goalsa goal and star are on this spacedraw goal first mapsurf blit(imagesdict['covered goal']spacerectthen draw the star sprite mapsurf blit(imagesdict['star']spacerectif there is star located at this xy coordinate on the map (which can be found out by checking for (xyin the list at gamestateobj['stars'])then star should be drawn at this xy email questions to the authoral@inventwithpython com