How to display consistent background image

Posted by Tofu_Craving_Redish_BlueDragon on Game Development See other posts from Game Development or by Tofu_Craving_Redish_BlueDragon
Published on 2014-05-08T08:16:06Z Indexed on 2014/06/07 21:38 UTC
Read the original article Hit count: 199

Filed under:
|

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?

© Game Development or respective owner

Related posts about python

Related posts about pygame