pygame is
Simple DirectMedia Layer is
Site Swing

PyRats - 0.03

Matt Windsor (captainhayashi)



A python remake/clone of the old windows 3.1 game Rats! by Sean O'Connor. (Name is very unimaginative and a bit too close to the original for comfort, so any suggestions on a better and less-likely-to-be-sued name are welcome =P)

Requires Pygame 1.8.0 or newer and Python 2 (tested with 2.6).

The objective of the game (which will come into play in a later release): Kill all the rats, before they mate out of control.

If a fertile male adult touches a fertile female adult (that isn't already expecting), they will mate and the now pregnant female will give birth to more rats. If unchecked, this could lead to a population explosion, and the end of your game.


  • Rat poison now included - you may now kill the rats. (Real gameplay still forthcoming)
  • Every rat now has its own name.
  • A message space at the top-left now lets you know what the rats are up to.
  • Did a bit of cleanup in the main loop.


Home Page:


click to view original size


PyRats - 0.03 - May 13, 2009
PyRats - 0.02 - May 9, 2009
PyRats - 0.01 - May 4, 2009 account Comments

If you wish to leave a comment with your account, please sign in first.

June 3, 2009 3:13am - Robin Wellner - nickname: (gyvox) - 5/5
It's getting pretty good! The /matt branch was very entertaining. You could add more initial rats, though. If you start eliminating them right from the start, it's dead easy.

BTW, I really like the sex change thing: "Jennifer has become male! He now prefers to be called Gordon."
May 27, 2009 5:19pm - Matt Windsor - nickname: (captainhayashi)
PyRats now has a SourceForge project space (nothing of interest there yet, though my current work on it is currently available through SVN): [].
May 24, 2009 12:22pm - Erik - nickname: (evildeeds)
@Robin: After I restructured the Rat class a bit it turned out to work best if the test is in choose_direction(). After all it was just a hunch of mine that it could be done in some better way, that only needed the current activator structure to work properly. It didn't.
May 24, 2009 11:03am - Robin Wellner - nickname: (gyvox)
@Matt: Sure, it's fine if you include them (after all, it's GPL), and you can just mention my name along with Erik's ;)

@Erik: you're right about the choose_direction() special case. It wasn't good enough. At first I placed that code in Director.activate(), but that was *way* worse.
May 23, 2009 2:35pm - Erik - nickname: (evildeeds)
@Matt: Go ahead and include it and as for the credits, just place my name somewhere around... Well, I don't know about Robin, but atleast I think its fine.
And where to place stuff, don't worry, Its my first time using Python for something else then a calculator. Redesigning the Rat class a bit could be the right way, lets say adding rat.change_direction(self, new_direction) is a good idea.
May 23, 2009 2:11pm - Matt Windsor - nickname: (captainhayashi)
@Erik: Had a look at your changes (and Robin's changes that you included). Would it be OK if I included them in 0.04, and if so, what form of credit would be best?

Also, if I'd coded the stop sign, I would have added a special test case in choose_direction, but that's because I'm a noob I guess =P

Also, my MSN/YIM/email is mattwindsor [[at]] btinternet [[dot]] com, if that helps.
May 23, 2009 11:27am - Erik - nickname: (evildeeds)
Anyone interested in my changes can get the source code from:

@Robin: I grabbed some of your modifications and added them. But to get the blockade object to actually do something need a bit of work, It didn't feel right to add a special test case in choose_direction().
May 23, 2009 5:31am - Robin Wellner - nickname: (gyvox)
My mod (including new "weapons"*) can be downloaded from:

@Erik: just upload it to mediafire and post a comment here, just like I did

* not actual weapons
May 22, 2009 9:01pm - Erik - nickname: (evildeeds)
I took myself a few hours to play with this, added a new weapon, changed the renderer quite a bit and was able to get slightly better framerate. I also fixed a few crash bugs, unfortunately I'm not sure how to get in touch with you so that I can share my changes with you atm.
May 21, 2009 4:34pm - Magnus LyckÃ?Â¥ - nickname: (mly)
Just name it Hameln or Hamelin, as in the location of the old German fairy tale. "The Pied Piper of Hamelin".
May 21, 2009 1:24pm - Robin Wellner - nickname: (gyvox)
Very nice. I made some "improvements" to it, but I can't reach it right now.
May 18, 2009 6:26pm - Thomas Downs - nickname: (tnelsond)
How about "Rat Trap"? Or perhaps "Sewer Pests"? Maybe "PyExterminator"?
May 4, 2009 9:01pm - Viktor Viktorov - nickname: (valambrian)
>any suggestions on a better and less-likely-to-be-sued name are welcome

Bloody PyRats?

our projects welcomes all python game, art, music, sound, video and multimedia projects. If they use pygame or not.
recent releases
Jun 25, 2016

Jun 19, 2016

Jun 17, 2016

Jun 12, 2016

Jun 3, 2016

Jun 1, 2016

May 27, 2016

May 21, 2016

May 18, 2016

... more!
for pygame related questions, comments, and suggestions, please see help (lists, irc)