Advancing PyMan (using python’s pygame to recreate pacman)

A while back I followed a few tutorials on creating a pacman game in python using pygame. I took the resulting code from these tutorials and added several enhancements. Unfortunately I haven’t had enough time to continue with the code, so hopefully this code is of use to someone learning python to play with and further enhance (Who knows might end up feature complete!).

Screen shot of PyMan in action

Screen shot of PyMan in action

Enhancements over original code

  • start menu
  • sounds
  • multiple ghosts
  • not having to hold down a directional button constantly
  • can press a direction before a turn and will turn at next opertunity (like real pacman)
  • probably more stuff that I’ve forgotten about by now

Source Files – The source and files, to run the game just run “python”

I believe the site where I got the original code from was (not 100% sure) and the following links to the tutorials:
Tutorial 1
Tutorial 2
Tutorial 3


  1. Tay

    After putting in the code I got this:
    “Traceback (most recent call last):
    File ‘/home/pi/Test Games/’, line 99, in
    AttributeError: PyManMain instance has no attribute ‘MainLoop'”

  2. y8 yepi

    Aw, this was an incredibly good post. Taking the
    time and actual effort to produce a superb article… but what can I say… I put things off a whole lot and never
    seem to get nearly anything done.

Leave a Comment

Your email address will not be published. Required fields are marked *