Posted 10 June 2015 - 05:00 PM
I made a gps minimap program, and it's really been the only thing I've been working on. The way it deals with off-screen waypoints is it draws it on the side it's gone past, but also at it's x position. Let me draw a diagram to explain.
I really need help with this little problem, as I've put it off too long…and don't have quite the skills to fix it myself.
Pastebin is at here: x9ajKSc0
Code:
I really need help with this little problem, as I've put it off too long…and don't have quite the skills to fix it myself.
Pastebin is at here: x9ajKSc0
Code:
Spoiler
if itemX > corner1[1] and itemX < corner2[1] and itemZ < corner2[2] and itemZ > corner1[2] then
if not (itemX == midPoint[1] and itemZ == midPoint[2]) then
if isConnected then
if colormode then
term.setTextColor(mapColors[3])
else
term.setTextColor(colors.white)
term.setBackgroundColor(colors.black)
end
write(waypointChar)
else
if colormode then
term.setTextColor(mapColors[8])
else
term.setTextColor(colors.black)
end
end
end
else
if colormode then
term.setTextColor(mapColors[4])
term.setBackgroundColor(mapColors[2])
else
term.setTextColor(colors.white)
term.setBackgroundColor(colors.black)
end
if itemX <= corner1[1] and itemZ <= corner2[2] and itemZ >= corner1[2] then
term.setCursorPos(corner1[1],itemZ)
write("<")
elseif itemX <= corner1[1] and itemZ <= corner1[2] then
term.setCursorPos(corner1[1],corner1[2])
if itemX * -1 >= itemZ * -1 then
write("<")
else
write("^")
end
elseif itemX <= corner1[1] and itemZ >= corner2[2] then
term.setCursorPos(corner1[1],corner2[2])
if itemX * -1 >= itemZ then
write("<")
else
write("v")
end
elseif itemX >= corner2[1] and itemZ <= corner2[2] and itemZ >= corner1[2] then
term.setCursorPos(corner2[1],itemZ)
write(">")
elseif itemX >= corner2[1] and itemZ <= corner1[2] then
term.setCursorPos(corner2[1],corner1[2])
if itemX >= itemZ * -1 then
write(">")
else
write("^")
end
elseif itemX >= corner2[1] and itemZ >= corner2[2] then
term.setCursorPos(corner2[1],corner2[2])
if itemX >= itemZ then
write(">")
else
write("v")
end
elseif itemX >= corner1[1] and itemX <= corner2[1] and itemZ <= corner1[2] then
term.setCursorPos(itemX,corner1[2])
write("^")
elseif itemX >= corner1[1] and itemX <= corner2[1] and itemZ >= corner2[2] then
term.setCursorPos(itemX,corner2[2])
write("v")
end
setDefaultColors()
end
Edited on 10 June 2015 - 03:03 PM