How to display consistent background image
- by Tofu_Craving_Redish_BlueDragon
Drawing a large background is relatively slow in PyGame.
In order to avoid drawing BG every frame, you could draw it once, then do nothing.
However, if something is overdrawn onto the surface and keeps moving, you will need to redraw the background in order to "erase" the color pixels left by moving object; otherwise, you will have "traces" of the moving object.
I have a moving object in my PyGame. However, I do not want to "clear the color buffer" by redrawing the background image. Redrawing the background image every frame is slow.
My solution :
I will "clear" only required portions (where the "traces" of moving object are left) of the "buffer" by redrawing portions of background.
Is there any other better way to have a consistent background?