2D Game Development in Python

Paul Boddie paul at boddie.org.uk
Fri Dec 21 07:14:38 EST 2007


On 21 Des, 02:16, PatrickMinnesota <PatrickMinnes... at gmail.com> wrote:
>
> I've been playing with Pygame some in my late night hobby time.  I'm
> wondering what else I should be looking at since I'm not all that
> impressed with Pygame so far.  Maybe it is the right library, but
> maybe it's not.  Please don't point me to a list of choices.  I've
> seen all the lists.  I've done my reading.  What I don't have is
> actual testimonials by people who have used a chunk of code to program
> an animated 2D game and had a great experience.

I guess it's not appropriate to point to a library like this...?

http://www.pygame.org/project/547/

The author of this library seems to be quite productive given that
he's released quite a few games of late. I've written one-and-a-half
games in Pygame, so I can't say that I can give you a testimonial, but
if you're familiar with the basics of 2D sprite plotting and animation
(not even to the level of the old days using microcomputers), then you
should be able to write something fairly quickly using Pygame.

Personally, I'm not too convinced about using a game library on top of
Pygame since the old discussion about frameworks and libraries comes
into effect: is working within the framework (or with the library) too
restrictive when you know exactly what you want to do? Nevertheless, I
can envisage situations, especially if you want to prototype stuff,
where a library would save you some time.

> I am mainly developing on Windows XP using Python 2.5.1.  I also have
> multiple Linux boxes that I am migrating my life to and so any game
> needs to be platform independent because I'll be on Linux full time
> soon.  If it's going to run on Windows and Linux, I think it should
> run on Mac too.

Well, Pygame uses SDL which is itself pretty portable.

> I've been developing systems and programs for over 20 years.
> Languages I'm an expert in include C, C++, Java.  I have a strong
> working knowledge and have developed non-trivial software in Smalltalk
> and Lisp.
>
> Thanks if you can help.  And no, writing some graphics library myself
> is not an option, I need the leverage, this is a hobby.

I think Pygame is a good foundation because of the SDL dependency. One
reads horror stories about getting certain other libraries working in
a short space of time in connection with the PyWeek challenges [1],
and I doubt that you really need OpenGL support or anything as
complicated as that. If you want to do particularly fancy effects or
transitions, it might be interesting to use Pygame's support for
Numeric - I've really only used Numeric for mundane things like
recolouring sprites, however.

Whether Pygame qualifies as a full "graphics library" according to
your expectations is probably something only you can judge at present.
If you expect full management of sprites, scrolling maps, and so on
then you will need to look into the add-on libraries for Pygame. There
are only three pages of libraries to look at here:

http://www.pygame.org/tags/libraries

Since many of them are very specific, it should be possible to rule
out a lot of them very quickly.

Paul

[1] http://www.pyweek.org/



More information about the Python-list mailing list