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

[pygame] speed



I am writing a fairly simple 2D sprite game.  2D grid, with perhaps some
occasional effects floating across.  I had a significant amount of work
done in C++, but the compile times were driving me insane.  I figured that
since the game was simple it might be smooth to move it over to
python.

Development speed has been brisk, but the same can certainly not be said
of the game.  Drawing a 16x12 grid of sprites to a 640x480
window went at around 55 fps in my unoptimized C++ code.  I've done
everything I can in python but the max I can get is 30, and I haven't even
included sound yet.

The profiler lists my animation drawing functions as the main culprits, so
I don't think it has too much to do with poor code elsewhere.

Does anyone have advice on getting some significant speed
improvements?  I'd expect python to be slower, but not by this much.  I'm
really worried that my time has been wasted because if
the game isn't playable there's not much I can do but head back to C++.

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