Reputation: 117
Pygame keeps flickering, even though it calls pygame.display.update
once.
I believe the problem is on screen.fill
(src.py, function clear
), but it doesn't work without it.
EDIT:
the complete code: find at http://mindgamestore.tk/pygame_code/
Upvotes: 1
Views: 10238
Reputation: 109
Reviving this to give an alternative solution.
So, at last, if nothing works, it is possible to simple remove pygame.HWSURFACE
and pygame.DOUBLEBUF
from pygame.display.set_mode
. This worked very well for me.
Upvotes: 1
Reputation: 117
Solved the problem: pygame.display.flip
was being called more than once on idraw
function.
Upvotes: 6
Reputation: 356
The problem is that pygame needs to clear the screen before doing anything.
So: in your while loop, before drawing anything on the screen, fill the screen with a color.
screen.fill([255,255,255])
If you have an back ground image, simply draw it after the above code .
Upvotes: 3