PyGame tips and tricks
I posted a list of tips and tricks that some may find useful for PyGame development (and some are generic enough for other frameworks as well).http://www.nerdparadise.com/tech/python/pygame/tipsandtricks/
If you have others you'd like to add to the list, let me know and I'll update it.
(log in to comment)
Comments
I'm not advocating for everyone to switch over. I would probably get burned at the stake. I mostly meant it from the perspective that you are either developing for both 2.x and 3.x, or primarily developing for 2.x but are simply conscious of the 3.x differences. Since I'd say 90% of PyWeekers are developing on 2.6 or 2.7 it would be unreasonable to develop primarily on 3.1. By all means, if writing code that works identically on both versions becomes burdensome, 3.x compatibility should be the one sacrificed, otherwise you'll get a barrage of DNW's. But if you are successful, it both adds a little future-proofness to your game and also runs a tad faster.
Usually what I do is develop on 2.6 and do final testing on 3.2 before I submit each feature to source control.
In practice I think both of those are the wrong way round: you might write a hundred loops, so use "for" to help ensure they all terminate and the game doesn't hang. You write one scene transition system, so ensure that the code paths to invoke the music are all watertight.
I disagree with the for loop advice too, it's premature optimisation that you will probably never notice.
The only thing that worked for me under Python 3 was installing pyglet system-wide with system-wide pip, from a tarballed sdist. My various virtualenv and setup.py experiments resulted in failure.
@richard: I'll encourage him to put some reports in. For my own experiments, I got as far as starting an issue report on Google Code, then decided I didn't know enough about packaging under Python 3 to understand what I should expect: I don't know how 2to3 is invoked or what packaging systems are supported.
richard on 2012/09/02 00:24:
Added to the sticky, thanks!