I have created Pygame, which has objects (balls) which randomly move around the screen and the mouse control a character which the user moves around to avoid the other objects. but the random ball that move around the screen have slow refresh rate (you can see them flashing while moving).
I don’t know which part of the code is to blame, the objects that move around are loaded here:
ballpic = pygame.image.load('ball.png').convert_alpha()
I don’t which other part of the game is to blame so I can include in question, so I have created a pastebin http://pastebin.com/H6KkTvZU which has the game code (short game).
Thank you
You call
display.update()on every iteration offor i in range(enemies)loop.Try doing it once per frame, after you have
blitted all the sprites.Even better, learn how to use
display.flip()properly; it’s faster if you update large portions of the screen.