You need to have every object positioned relative to the world, not instead of the screen. Your camera should also have its own world coordinates so it can be drawn at a relative position in the world. It may also be convenient to have your camera follow an object, so wherever the object is, the camera just uses its coordinates. Now typically,Typically the camera's coordinates will position it from the upper left corner. This means the camera would have a world position of approximately (0,24) in the [picture][1].
As for actually drawing the objects the camera can "see", you nowmust draw all objects relative to the camera's world coordinates. To compute an object's screen position relative to the camera, simply do:
int screenX, screenY; //screen position of the object being drawn
screenX = object.x-camera.x;
screenY = object.y-camera.y;
Now obviouslyObviously some objects are not actually visible to the camera, so you may want to check if the screen position for any object to be drawn is within the camera'simplement a view culling system. [1]: https://i.sstatic.net/GF4lH.png