coordinate (which is done on line before the star is drawnthe code should first check if there is also goal at this locationin which casethe --covered goal|tile should be drawn first elif (xyin goalsdraw goal without star on it mapsurf blit(imagesdict['uncovered goal']spacerectif there is goal at this xy coordinate on the mapthen the --uncovered goal|should be drawn on top of the tile the uncovered goal is drawn because if execution has reached the elif statement on line we know that the elif statement' condition on line was false and there is no star that is also at this xy coordinate last draw the player on the board if (xy=gamestateobj['player']notethe value "currentimagerefers to key in "playerimageswhich has the specific player image we want to show mapsurf blit(playerimages[currentimage]spacerectreturn mapsurf finallythe drawmap(function checks if the player is located at this xy coordinateand if sothe player' image is drawn over the tile line is outside of the nested for loops that began on line and so by the time the surface object is returnedthe entire map has been drawn on it checking if the level is finished def islevelfinished(levelobjgamestateobj) """returns true if all the goals have stars in them "" for goal in levelobj['goals'] if goal not in gamestateobj['stars'] found space with goal but no star on it return false return true the islevelfinished(function returns true if all the goals are covered stars some levels could have more stars than goalsso it' important to check that all the goals are covered by starsrather than checking if all the stars are over goals the for loop on line goes through the goals in levelobj['goals'(which is list of tuples of xy coordinates for each goaland checks if there is star in the gamestateobj['stars'list that has those same xy coordinates (the not in operators