Centering Text Map and maintaining 13x13
|
|
Code:
mob/proc/ShowMap() var buf = "" top = min(y+client.view+6.5, world.maxy) bottom = max(y-client.view-6.5, 1) left = max(x-client.view-13, 1) right = min(x+client.view+13, world.maxx)
for(var/yy = top, yy >= bottom, yy--) for(var/xx = left, xx <= right, xx++) var/turf/T = locate(xx,yy,z) var/mob/M = locate() in T if(M) buf += M.text else buf += T.text buf += "\n" mb_msgout("")
mb_msgout(buf)
mb_msgout("Location: [x],[y]") mb_msgout("Nearby: ") mb_msgout("Facing: [Direction]")
|
Problem description:
I am making a MUD... I have outputting the map to text like above! I am trying to figure out how to keep the players * character centered on the screen... Also, currently I spawn at 1,1,1 and the map is small and when moving it just keeps getting bigger... i wanna maintain 13x13 regardless of position if on edge or anything.
|