[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pygame] speed problem: max 6 fps



Gerrit Holl wrote:
I have written a small pygame game which won't run at more than 6 fps.
Approx. 55 Sprites live in a Surface, sized 2500 by 3000.
The profiler tells me almost all time is in the main function.
What does this tell me about the bottleneck of my little game?
without actually running the game, just browsing the source, i see you are not properly converting the loaded images to match the display.

> self.image.convert()

the Surface.convert() method returns a new Surface that is converted. you will need to change these lines into this

self.image = self.image.convert()

still, it looks like the background image should already be the right format, which should make a large difference. hopefully i'll get a chance to run the code tonight and see what's really going on.

____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org