Fork me on GitHub

Pman Postmortem

Atul Varma - July 29, 2003

Pman is a Pac-Man clone I created over a period of about three weeks of intermittent coding. You can download the source tarball here.

The core game logic and graphics are fully implemented: there's a main menu, hi-score list, and a demo (aka attract) mode; once the game starts, Pac-Man can eat fruits, pellets and power pellets, be killed by ghosts and eat them, win levels to face-off against harder ghosts, and so forth. A scoreboard keeps track of the player's score and lives left. Everything is fully animated, except for Pac-Man's gruesome death.

The game's codebase is platform-independent, and the game has been compiled and run successfully on Windows, Mac OS X, and Linux.

The only third-party code involved in this project was the use of the Simple DirectMedia Layer (libsdl.org), a cross-platform, low-level multimedia API. This library provided basic routines for video access, blitting, and bitmap loading, as well as input and timing functionality. All other code was written by myself. Finite State Machines were researched and implemented to represent the gameplay state and the game agents, and a time-based message routing subsystem allowed them to communicate with each other; integer-based fixed-point math routines were derived and used for real number calculations; drawing algorithms were researched and implemented for the rendering of basic graphics primitives such as lines, circles, and triangles, and these functions were combined to dynamically generate graphics for Pac-Man and the ghosts on-the-fly; shortest-path algorithms were researched and implemented for ghost AI; a basic bitmap font library was coded to draw text to the screen; and a model-view-controller architecture was used to provide for extensible, "pluggable" game modules. This architecture also provided for a framework that semi-decoupled game logic from on-screen rendering (described in more detail below).

Goals:

The purposes of the Pman project were manifold:

What went right:

What went wrong:

Conclusion:

Game Data: