• Zeth will be attending PyCon UK on the 12th to 14th September 2008.

5 Homebrew Python Games

2 September 2007

What is PyGame?

The Open Graphics Library (OpenGL) is used to make 2D and 3D graphics, it is the main competition to Microsoft's 'Direct' library. On top of this you can run the Simple DirectMedia Layer (SDL), this provides access to OpenGL and to the sound, keyboard, mouse and so on.

On top of this you can run Pygame, which is a library of Python modules that you can use to write graphical computer games in Python. This is where the fun begins. As well as providing the library, the Pygame website hosts games made by Pygame hobbyists, many of these games are made during one week game writing contents called 'Pyweek'.

I thought I would look at some of the games made with Pygame. No order or planning went into the selection of these, these are literally the first five games that I game across. As normal, click on the screenshots to enlarge.

PyTanks (unknown licence)

The first game, PyTanks by Joel Stenkvist, is a Scorched Earth-style artillery game (you younger people will know the game 'Worms' with its amusing sound effects). The idea is that you get all your friends around, take a tank each and blow each other up, all good clean fun!

`.. image:: http://commandline.org.uk/images/posts/pygame/pygame-tank.png

System Message: WARNING/2 (<string>, line 25); backlink

Inline interpreted text or phrase reference start-string without end-string.
alt:Tank game

System Message: WARNING/2 (<string>, line 27)

Definition list ends without a blank line; unexpected unindent.

`_

System Message: WARNING/2 (<string>, line 27); backlink

Inline interpreted text or phrase reference start-string without end-string.

Endgame: Singularity (Open Source - GPL)

The next game was my favourite, `Endgame: Singularity`_ by 'Evil Mr Henry', is a strategy game where you play an Artificially intelligent program that is accidentally created on a University computer. You have to hide from the suspicious and hostile human race by obtaining as much computer power as possible, you can hack PCs or order custom clusters, build a race of robot helpers and even create server rooms in space. I do not want to give away much more as it spoils the fun.

`.. image:: http://commandline.org.uk/images/posts/pygame/pygame-endgame- singularity.png

System Message: WARNING/2 (<string>, line 41); backlink

Inline interpreted text or phrase reference start-string without end-string.

System Message: ERROR/3 (<string>, line 43)

Unexpected indentation.
alt:AI Game

System Message: WARNING/2 (<string>, line 44)

Block quote ends without a blank line; unexpected unindent.

`_

System Message: WARNING/2 (<string>, line 44); backlink

Inline interpreted text or phrase reference start-string without end-string.

I really enjoyed playing the game through, but once you get the idea then the human race is not much trouble. What would really extend the game further would be a multiplayer mode, several AIs competing for resources and giving away the enemy AIs' positions to the humans would be really cool. I will certainly keep an eye on future development to see how he takes this game forward.


Galcon (Shareware i.e.Try before you buy)

Galcon by Phil Hassey is a nice little game where you have to send all your space ships between planets in order to control the galaxy.

`.. image:: http://commandline.org.uk/images/posts/pygame/pygame-galcon.png

System Message: WARNING/2 (<string>, line 60); backlink

Inline interpreted text or phrase reference start-string without end-string.
alt:Galcon screenshot

System Message: WARNING/2 (<string>, line 62)

Definition list ends without a blank line; unexpected unindent.

`_

System Message: WARNING/2 (<string>, line 62); backlink

Inline interpreted text or phrase reference start-string without end-string.

Like many homebrew games, it is a bit too easy and simplistic once you have mastered the initial step, but otherwise it is fast moving, responds well and looks good.


GalaxyMage (Open Source - GPL)

Somewhat more ambitious is GalaxyMage. GalaxyMage is a turn based fantasy role playing game, that looks and feels like the tabletop war games that I played in my early teens, although the advantage of the computer game version is that it does not take half a day to lay out all the troops! If you have played these table top games then you will know the format already, each of your little men has a basic turn which consists of move then attack/spell.

`.. image:: http://commandline.org.uk/images/posts/pygame/pygame- galaxymage.png

System Message: WARNING/2 (<string>, line 79); backlink

Inline interpreted text or phrase reference start-string without end-string.

System Message: ERROR/3 (<string>, line 81)

Unexpected indentation.
alt:Fantasy Game

System Message: WARNING/2 (<string>, line 82)

Block quote ends without a blank line; unexpected unindent.

`_

System Message: WARNING/2 (<string>, line 82); backlink

Inline interpreted text or phrase reference start-string without end-string.

GalaxyMage supports both single player and multi-player modes, and with a little bit more development could be a real goer, I can imagine a scene forming around it with different groups making different units, terrains and scenarios.


Colonel Wiljafjord and the Tarbukas Tyranny (Licence unknown)

The last game, Colonel Wiljafjord and the Tarbukas Tyranny, again by Phil Hassey, is a graphical adventure/puzzle game in the style of Day of the Tentacle or Monkey Island. It only seems to have one level at the moment (it was a PyWeek entry), but it is really nicely drawn and narrated. It shows what could be archived with PyGame in this genre.

`.. image:: http://commandline.org.uk/images/posts/pygame/pygame-colonel- wijafjord.png

System Message: WARNING/2 (<string>, line 99); backlink

Inline interpreted text or phrase reference start-string without end-string.

System Message: ERROR/3 (<string>, line 101)

Unexpected indentation.
alt:Puzzle Game

System Message: WARNING/2 (<string>, line 102)

Block quote ends without a blank line; unexpected unindent.

`_

System Message: WARNING/2 (<string>, line 102); backlink

Inline interpreted text or phrase reference start-string without end-string.

`.. image:: http://commandline.org.uk/images/posts/pygame/pygame-colonel- wijafjord2.png

System Message: WARNING/2 (<string>, line 106); backlink

Inline interpreted text or phrase reference start-string without end-string.

System Message: ERROR/3 (<string>, line 108)

Unexpected indentation.
alt:Another shot of the Puzzle Game

System Message: WARNING/2 (<string>, line 109)

Block quote ends without a blank line; unexpected unindent.

`_

System Message: WARNING/2 (<string>, line 109); backlink

Inline interpreted text or phrase reference start-string without end-string.

So they were the games that I played, if you try out any cool ones then let me know in the comments. Happy playing.

Docutils System Messages

System Message: ERROR/3 (<string>, line 33); backlink

Unknown target name: "endgame: singularity".

1 bug says...

Nice computer game. But I really can't figure how to not get exposed. Mind tipping me?

Posted at 1:08 p.m. on September 2, 2007


What do you have to say?

Show Editing Help


PyCon UK

About

Hello, my name is Zeth, I'll be your host here.

Command Line Warriors is about taking control of your own technology, it looks at our experiences of computing; especially using GNU/Linux, the Python programming language, the command-line and issues such as techno-ethics, best practices and whatever is cool now. If you take control of your technology then you are a Warrior too!

This site is your site too which means that you can contribute and get involved. You can leave comments using the facility provided. For me, the comments and discussions are by far the best part of the site. So please do have your say!

Latest Discussions

Naib

August 27, 2008
And the greatest flaw with this "simple" talley? Women's eights final: 1 United States 6:05.34 Gold 2 Netherlands 6:07.22 Silver 3 Romania 6:07.25 Bronze Men's quadruple sculls final: 1 Poland ...
An Alternative Olympic Medal Table

james

August 27, 2008
Great discussion and a great "add-on" with the European countries! I still find medals per Capita very interesting because it indicates how many medals a country has won, from the ...
An Alternative Olympic Medal Table

Steve

August 27, 2008
Flawed logic. This comparison would only make sense if the EU could only send the same amount of competitors as a single country. Since it is treated as many small ...
An Alternative Olympic Medal Table

Zeth

August 27, 2008
Hi Benjamin, as far as I know, you can put any GSM SIM card into your OpenMoko, so you have the freedom to choose the best deal for you from ...
OpenMoko vs iPhone - Free your phone or Fight your phone?

Benjamin Melançon

August 25, 2008
Network question. I know more about computers than cell phones. Can anyone tell me or point me to a resource about what purchase options for network access are. For instance ...
OpenMoko vs iPhone - Free your phone or Fight your phone?

Mark (Cycom on freenode)

August 23, 2008
Two separate ideas here: First: Is not the competition between KDE and GNOME a good thing? It drives both to improve in a way that Mac and Windows and Linux ...
Is GUADEC just GDEC?

Zeth

August 21, 2008
Thanks for your comments guys, the newspapers need to sit a while on the naughty step until they are willing to play nicely. John Reese, thanks for visiting, it is ...
Newspapers please link to your sources

John

August 20, 2008
Zeth, The link to this file (for view wireless history) doesn't bring up a dialogue. Could you fix this?
Five Tips for Easter

John Reese

August 20, 2008
They're *carts*, not "trolleys"! ;)
Newspapers please link to your sources

akahn

August 20, 2008
Control-L usually selects the whole address, so only Control-L Control-C would be needed.
Newspapers please link to your sources

Sean

August 20, 2008
That was good. I'm crackin' up.
Newspapers please link to your sources

Garrick

August 20, 2008
Here here!
Newspapers please link to your sources

Seth Kriticos

August 19, 2008
bkil: "GTK and Gecko-tied extensions could be ported to non-gecko browsers." *cough* Epiphany is running on gecko currently and integrates some extensions thereof, they are just planning to switch to ...
Will Epiphany be able to compete with Firefox's extensions?

Harshad Modi

August 18, 2008
Thanks helping me!!! but I have problem on banner.... I try to make my own sftp server using paramiko inherit paramiko.ServerInterface class. but I got this error: ERROR:paramiko.transport:SSHException: Error reading ...
SFTP in Python: Paramiko