Ok, basically I almost have this solved but here is the code I am using now.
function camera2map(x,y)
x=x+Camera.x
y=y+Camera.y
GlobalVec.x = x
GlobalVec.y = y
endfunction
function map2camera(x,y)
x=x-Camera.x
y=y-Camera.y
GlobalVec.x = x
GlobalVec.y = y
endfunction
function movecamera()
moveLeft = False
moveRight = False
moveUp = False
moveDown = False
if rightkey()=1 then moveRight = True
if leftkey()=1 then moveLeft = True
if downkey()=1 then moveDown = True
if upkey()=1 then moveUp = True
if moveRight = True then Camera.x= Camera.x-10
if moveLeft = True and Camera.x<LEFTWALL then Camera.x= Camera.x+10
if moveUp = True and Camera.y<UPWALL then Camera.y= Camera.y+10
if moveDown = True then Camera.y= Camera.y-10
endfunction
I am mother and father, but never nurse.I'm rarely still, but I never wander. What am I?
See my sketch