Programming Games in Python

Although not the most famous facet of Python, Python is a language with has enough possibilities for programming games in python. On the one hand, it combines the depth and resources of using C / C ++ libraries, and on the other the ease of using Flash, with an average performance between the two. So many times it is a good language to program complex things quickly, although obviously sacrificing performance, being games interpreted and not compiled.

Programming Games in Python

Here is a brief overview of the most useful libraries for developing video games:


Undoubtedly the most famous library of Python. Pygame has been developing since 2001 so it has a large community, publishing on its own website a lot of games and demos with more than 1,000 registered projects. It is multi-platform to perfection and the library that gives less problems when porting between Linux / Windows / Mac, and is famous for its ease of programming. It uses a library of C called SDL, library in which are written the most famous 2D games in Linux like Battle for Wesnoth, SuperTux or StepMania.


Speaking of Pygame, it has a fault, and that does not support graphics acceleration based on SDL. Here comes PyOpenGL, a OpenGL binding that can be combined with Pygame to add the functions that are missing. Of course, it requires a higher level of knowledge of video game programming, since it is a layer of higher abstraction. For those who do not know OpenGL, it is the DirectX competition in the free software world, and all free and closed 3d games run on it including Blizzard and Valve games.


Pyglet is the alternative to Pygame + PyOpenGL enabling graphics acceleration and work in 2D / 3D, all in a single library, without having to resort to cumbersome PyOpenGL difficulty. yes, sacrificing some advanced utilities of pyopengl, and being a little more difficult to use than Pygame. It is a library with a current development faster than pygame, it gains more followers everyday. Pyglet actually uses OpenGL in most of its functions.


Free Library focused on 3D games written for Python and C ++. It is a 3D-oriented library, and therefore not suitable for beginners. Some Disney games have used this library.


Library Specifically to create physical 2D, as polygons, collisions, etc. It is based on the famous chipmunk library, you can watch this video demonstration.


This framework is an extension that adds a lot of effects to Pyglet, rotate and manipulate sprites, transitions between scenes with styles, etc. Combining Pyglet + Cocos2d you can make games of great quality.


Binding for python Ogre, a popular 3D rendering engine in C ++ with an active community . It should be complemented with other 3D libraries like PyOpenGL.

On official Python website you can find a more extensive collection of programming games in python libraries:

Need help with python game development ? You can contact us to hire a dedicated python programmer for games, GUI or other python programming requirements .

Leave a reply