Adding a camera to your game allows you to have bigger worlds which don't entirely fit on the screen at once. It can be implemented by simply subtracting the camera position from each sprite/tile position in the game. We go over the code for this in this video.
Check out the entire playlist:
• Pygame - Adventure Game
Completed Source Code:
https://github.com/AlexanderFarrell/a...
Previous Step Source Code (if you want to follow along):
https://github.com/AlexanderFarrell/a...
Camera Icon Credit:
https://pixabay.com/vectors/camera-ph...
Timestamps:
00:00 - Intro
00:13 - Camera
02:03 - Integrate with Game
02:50 - Update Draw Code
04:09 - Move Camera with Player
05:40 - Center the Camera on Player
08:13 - Conclusion