Can you explain what you mean? Presumably a view point that can be moved independent of the world space... if so then yes, by moving everything...
a simple and crude example implementation is to create an x and y offset for the camera, and draw everything relative to the offsets. So rather than drawguy(guy.x, guy.y) you would do drawguy(camera.x + guy.x, camera.y + guy.y).
In the above example you do have to adjust the camera in an inverted fashion, that is to say if you want to move the view point right (increase the viewpoint's x), you have to move the world right (by actually decreasing the viewpoint's x...). You can perform the inversion either when you alter the offset (to move the viewpoint right, you subtract units from it's offset rather than add them...), OR when you reference the offset (use -camera.x instead of camera.x).
Last edited 2011
|