loop % This loop draws the map from an array loop if mapPartsArray (curPosition, curObjectType) = "1" then % If the current position in the array is a 1, draw the ground curPosition := curPosition + 1 % Move over one char in the array Pic.Draw (groundblockimg, groundxpos, 0, picCopy) % Draw it groundxpos := groundxpos + 30 % gotta move over 30px for the next ground block delay (100) %put mapStats(curObjectType) mapStats (curObjectType) := mapStats (curObjectType) - 1 % We need to countdown the objects, since we've used one end if if mapPartsArray (curPosition, curObjectType) = "0" then % Don't draw it if it doesn't exist. Just move over 30. curPosition := curPosition + 1 groundxpos := groundxpos + 30 mapStats (curObjectType) := mapStats (curObjectType) - 1 %put mapStats(curObjectType) end if exit when mapStats (curObjectType) = 1 end loop curPosition := 1 groundxpos := 0 curObjectType := curObjectType + 1 loop if mapPartsArray (curPosition, curObjectType) = "1" then % If the current position in the array is a 1, draw the ground curPosition := curPosition + 1 % Move over one char in the array Pic.Draw (hill1, groundxpos, 60, picMerge) % Draw it groundxpos := groundxpos + 100 % gotta move over 30px for the next ground block delay (100) %put mapStats(curObjectType), " ".. mapStats (curObjectType) := mapStats (curObjectType) - 1 % We need to countdown the objects, since we've used one end if if mapPartsArray (curPosition, curObjectType) = "0" then % If the current position in the array is a 1, draw the ground curPosition := curPosition + 1 % Move over one char in the array groundxpos := groundxpos + 100 % gotta move over 30px for the next ground block delay (100) %put mapStats(curObjectType), " ".. mapStats (curObjectType) := mapStats (curObjectType) - 1 % We need to countdown the objects, since we've used one end if exit when mapStats (curObjectType) = 1 end loop exit when 1 = 1 end loop