So what you are saying is to go through and subtract the camera position from the position of each object on the map, from the player to the blocks that make up the stage itself? This is something that I have tried, but the objects that go under 0, 0 as their coordinates (-100, 0, for example) are rendered at the origin (upper-left-hand corner) of the screen. Perhaps adding if(object[c].x-camera.x<0 || object[c].y-camera.y<0) display[c]=0;
(with display[c]=0; disabling displaying the tile) will make the object not be displayed if it has such coordinates? Did I read your response incorrectly, or are we on the same page? Move all of the objects in the map in order to have camera movement? And does the solution I posted work? Thank you for your time. I appreciate it.
EDIT: The problem with the code I posted is that if an object goes beyond 0, 0, it isn't displayed. This is good, but part of the object would be cut off each time. Time for another diagram.
And because the block can't be drawn from before 0 so it is only halfway into or halfway out of the viewing area, that is not an option. How would I avoid such a problem? I know I could put a black border around the screen, but there has to be some other way to do this. Do you understand what I'm saying? Even if the X Coordinate of a block is -400, it is still displayed at 0 on the screen for its X Coordinate.
Again, thanks. I apologize if I am not being easy to understand.
EDIT #2: I made a program prints the X Coordinate of an object after setting that to -400 and it prints 0 instead. I'm going to conclude that object.x and object.y are unsigned integers and therefore can't be set equal to anything less than 0 and be expected to work. All of this is how I got lost in the first place when trying to figure out how to get a camera working. Please give me your insight. Thanks.