Image

Imagesciucaro wrote in Imagepython_dev

In Pygame, using 2D graphics, when you are trying to make a side-scroller or some sort of game that might allow for camera-like effects similar, do you have to update the entire background and level to give the effect of moving your character in it, or is there some sort of camera trick where only the character moves instead of the whole level, and there's some display object that will just follow the character and whatever is inside it will display?

I wish I had some sort of graphic to explain this. Like:

Imagine a big square (the level or background), a character (your character), and a small hollow rectangle (what the screen displays),all visibly on top of each other. When you move the character, does the hollow rectangle stay stationary and the character have a limited range to move, and the whole level square is what is moving for the effect? Or can the character freely move, have the rectangle follow the character and the level stay stationary?

Or is there an even better way to do this?

Thanks in advance.