oh missed this new comment
Yeah its a problem most people com to at one point or later.
i usually do it like this:
have for all object a set o cordinates like worldx# and worldy#.
these dont have to have anything to do with the screen. they are just relative.
then you have a function Getx() and Gety
theese look like this in general.
function Getx(worldx#,camerax#,zoom#,screenwidth)
x# = worldx#*zoom#-camerax#*zoom#+screenwidth/2.0
endfunction x#
function Gety(worldy#,cameray#,zoom#,screenheight)
y# = worldy#*zoom#-cameray#*zoom#+screenheight/2.0
endfunction y#
where worldx# and camerax# are coordinates in the realtive world set of coordinates.
these could be like 1 and 4.9
zoom# is a value that defines the scale between the world and the screen. it could be 55.1
with these values and a resolution of 600x800
the x# would be 185.11 in screen coordinates.
this way just by manipulating the camerax# and cameray# coordinates, you can "move" everything else, while whatever is at camerax#,cameray#, like your ship/soldier/house will always be in the center of the screen. also the zoom# value can smoothly be used to zoom in on stuff. just remember to scale the sprites accordingly.
hope this clarified it a litle