views:

1207

answers:

9

What's the best toolkit for doing 2d game programming with Python? I've heard of pygame but is there anything I should add to it or is there another group of modules that surpasses it?

A: 

I've only heard people talk about pygame. It has tons of followers & plenty of functionality.

Recently I saw this book at barnes & noble which I might check out one day. It looked good.

Ben Scheirman
+3  A: 

I think pygame is the standard for game development in Python, I don't know of any others. A book you may be interested in is Game Programming with Python, Lua, and Ruby. Not only does it cover Python (and, I believe, the pygame module), but it also gives you exposure to Lua and Ruby. It's also available on books24x7 if you have a subscription there.

Justin Bennett
+5  A: 

A blog post covering several of the alternatives, including PyGame, PyCap, SpriteCraft, and ika. I have also seen pyglet mentioned.

You may also want to look at Panda, which is a very easy to use 3D engine with Python bindings. It is used for rapid prototyping at Carnegie Mellon's ETC.

Nathan
+11  A: 

I use pygame myself and it is very good. It has good documentation and tutorials, and is quite well designed. I've also heard wonderful reviews of pyglet.

dwestbrook
A: 

pyGame is impressive

Abhishek Mishra
+4  A: 

I have used and would highly recommend pyglet, which provides 2D sprite graphics, hooks into OpenGL effects, audio support, file asset management, and excellent text layout and display support (not something you always find in a 2D game library). The API is sane, well-documented, and easy to get started with, and goes deep (especially if you're an OpenGL wizard).

As a companion to pyglet, I have used and would also suggest Cocos2D, which adds scene management, improved sprites, tiled map support, and fancy (accelerated) effects to add a little polish. Cocos is still young, but taking shape quickly, and already has fairly solid documentation.

David Eyk
+1  A: 

Another option is pycap which is a wrapper for the popcap framework with Python.

A: 

A followup question:

Can't I just code a simple 2D game inside some existing graphic/windowing toolkit like the excellent wxPython ?

I will benefit from the ready-made GUI widgets that can wrap the graphics in my game, while with pyGame I have to develop those myself.

Eli Bendersky
You should add the question to your original post. The answer is, Pygame provides a lot of helper functions GUI toolkits lack.
Seun Osewa
+1  A: 

If you're already familiar with using OpenGL in another language (probably C or C++) then PyOpenGL is awesome. I was surprised as to how easy it was to switch from OpenGL/C to OpenGL/Python. The performance isn't half bad either.

I've heard good things about PyGame and Pyglet though I must admit I haven't really done much messing around with either one.

Jonathan Ford