wkeeling/arkanoid

Possibly introduce DirtySprite

Opened this issue · 1 comments

Many of the sprites are being blitted to the screen 60 times per second even though they aren't changing often - e.g. bricks and edges.

Might be worth introducing the DirtySprite base class for all sprites, and then setting/checking the 'dirty' attribute when deciding whether to blit.

Note that this has been tried experimentally before with the ball/paddle in conjunction with the LayeredDirty sprite group and display.update(). This was a mixed success, as although the sprite movement appeared smoother, the sprites didn't render correctly and were slightly distorted.

May need to use the DirtySprite concept but do the dirty check manually (rather than using LayeredDirty/display.update()) and continue to use display.flip()

Some initial testing using DirtySprite and LayeredDirty with both display.flip() and display.update() makes no visible difference in terms of the smoothness of the rendering.