This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Two user-friendly classes for integrating a 2D camera system for pygame. | |
# | |
# The first class is Camera2, which is essentially a 2D camera with rect-like behaviour. To setup something like player tracking, one can simply do: | |
### Cam2 = Camera2(area=(0, 0, WIDTH, HEIGHT), view_distance=1000) | |
### Cam2.center = player.rect.center | |
# for even more precise control, one can do: | |
### Cam2.anchor = (Cam2.w*0.3, Cam2.h*0.7) # some coordinate on the screen |