I'm building a program that displays a high-resolution character on a breathing loop at 30 fps and key events trigger changes in which loop is being displayed in order to make the character move.
There are 21 different folders each containing 150 frames (they all fit into a 5-second breathing loop). 240MB total for 3000+ PNGs
.
After loading all of these images from their directories, converting them, storing into sprite classes, and then groups in order to call pygame.draw(screen)
when the loop becomes activated, my memory maxes out and the program runs poorly. The program runs fine with only a few test PNGs
. I'm open to slightly reducing the resolution of the character but I would prefer to maintain max quality.
Is there a better way to do this or am I correct trying to use pygame?
Perhaps pygame
isn't the best library to use for this situation?
(I'm new to programming so using pygame
made the most sense to me for displaying animated sprites)