lines to position the camera and draw the map and other graphics to the display surface object in displaysurf if the level is solvedthen the victory graphic is also drawn on top of everything else the keypressed variable will be set to true if the user pressed key during this iterationat which point the runlevel(function returns def iswall(mapobjxy) """returns true if the (xyposition on the map is wallotherwise return false "" if len(mapobjor len(mapobj[ ]) return false and aren' actually on the map elif mapobj[ ][yin ('#'' ') return true wall is blocking return false the iswall(function returns true if there is wall on the map object at the xy coordinates passed to the function wall objects are represented as either 'xor '#string in the map object def decoratemap(mapobjstartxy) """makes copy of the given map object and modifies it here is what is done to it walls that are corners are turned into corner pieces the outside/inside floor tile distinction is made tree/rock decorations are randomly added to the outside tiles returns the decorated map object "" startxstarty startxy syntactic sugar copy the map object so we don' modify the original passed mapobjcopy copy deepcopy(mapobjthe decoratemap(function alters the data structure mapobj so that it isn' as plain as it appears in the map file the three things that decoratemap(changes are explained in the comment at the top of the function remove the non-wall characters from the map data for in range(len(mapobjcopy))for in range(len(mapobjcopy[ ]))if mapobjcopy[ ][yin ('$'''@''+''*')email questions to the authoral@inventwithpython com