Pygame Posts

17 posts tagged with pygame

Instant Pygame for Python Game Development How-to

Instant Pygame for Python Game Development How-to

Packt Publishing have released Instant Pygame for Python Game Development How-to, a guide to getting started with PyGame, written by Ivan Idris. This title will help you get over the initial hurdles in setting up a PyGame environment and developing your own games.

I was the technical reviewer for this book.

A bad review

I got a bad review of my book on I wanted to post a comment to address his points, but Amazon told me that I must have purchased an item to post -- which I have (many times)! So I thought I would post my comment here (below).

I'm the author of Beginning Game Development with Python and Pygame. Let me take a moment to comment on your scathing review.

1) As the title of the book indicates, the book is intended for beginners. As such there is an introduction to Python in the first two chapters. A total of 30 pages out of approximately 300. I don't think this is unreasonable. continue reading…

Table of Contents for Pygame Book

The following is a list of the chapter titles for Beginning Game Development with Python and Pygame, and a brief explanation of the contents.

Any questions about the book contents, let me know!


Introduction to basic Python.

Goes a little deeper in to Python, covers Classes.

Explains how import and use Pygame.

Covers different ways of drawing to the screen.

Explains animation, vectors and time-based movement.

Covers how to read input devices and connect them to in-game motion.

Covers artificial intelligence.

Explains the basic 3D concepts, with samples.

Covers 3D maths and introduces OpenGL.

Sound and Music.

Covers textures and reading 3D models from files.

Covers lighting, blending, fog and other OpenGL features.


Free chapter of Beginning Game Development with Python and Pygame

My book, Beginning Game Development with Python and Pygame, is finally finished! It was a labor of love, and a lot of work. Apress have graciously allowed me to give away a free chapter.

I chose chapter 7, which is on the subject of Artificial Intelligence. I selected this chapter because it is nicely self-contained and doesn't require much additional understanding of other game concepts. It is an unusual chapter, in that it contains the largest listing in the book. I tried to avoid really long listings, but in this case I think it was justified so that the code in the book actually runs; I hate leaving any code as an exercise for the reader.

Download Chapter 7, Take me to Your Leader continue reading…

Download Chapter 7, Take me to Your Leader continue reading…

Transparently Recording Game Demos

I have many ideas in the course of any given day. They are dredged up from the depths of my subconscious and placed on my mental in-tray, to be sorted in to mental heaps. Most are placed on to the "that'll never work" heap, others are thrown on the "better not, that's probably illegal" heap or the "plutonium isn't available at every corner drug store you know" heap. Occasionally though, some make it to my mental out-tray. continue reading…

Master time with PyGame

A novice games programmer learns he can move a sprite by adding a constant to its position every frame. For a while he is happy and mocks the master games programmer for having wasted many years learning. But soon the novice realises his sprites are unpredictable and move at different rates on different machines. The novice is despondent and visits the master for advice.

"Master. Why do my sprites not obey my commands? They jump when I ask them to slide."

"Frame rate is like the wolf, it can not be tamed", replies the master. continue reading…

Game Objects Commandments

I've moved Game Objects to Google Code. It's new home is There are source and Win32 packages available.

Game Objects is intended to be a collection of classes to assist with the creation of games, or other realtime applications. Currently there is a 2D and 3D Vector class, and a well optimized 4x4 Matrix class, but eventually Game Objects will contain code for general route finding, entity management, AI and other cool stuff. I'm happy to take suggestions, and if you would like to submit code - even better! All classes should following these commandments.

OpenGL sample code for PyGame

I've uploaded a simple example of how to use OpenGL with PyGame. It's a listing from my forthcoming book, Beginning Game Development with Python and PyGame, and demonstrates how to initialize OpenGL, create a light and draw a simple 3D 'world'. It also shows how to use the camera matrix to create a simple 'fly-cam'.

To run it you will need PyOpenGL, which you can download from the website, or from the command line if you have Easy Install (type easy_install PyOpenGL). Use the cursor keys to look around, and the Q/A keys to move forward and back. You can also press Z and X to roll the camera.

Here's a screenshot. continue reading…

Micro-optimizing Python code for 3D

I enjoy optimizing code. These days I don't get the opportunity to do it very often, since I prefer working in high level languages now. Which is why I have been particularly enthusiastic in optimizing the 3D math classes in Game Objects. continue reading…

Game Objects 3D math

I've just uploaded a new version of Game Objects. The 3D maths classes (Vector2, Vector3 and Matrix44) are reasonably stable now. I'd like to invite Python coders to play around with them, and suggest any improvements. My intention was to make something that was very easy to use, but well optimized. Game Objects is public domain. Do what you want with the code - go crazy!

There is no documentation at the moment I'm afraid, but here are a few edited highlights.