× Home Design Doc
Vectors Stacks Phase 1 Phase 2 Phase 3 Phase 4 Phase 5 Phase 6 Comics About Contact
pacman

CODE

The design document explains the logic and the rules of the game that we need in order to program the game. It is a good idea to start with a design document like this one before we start to code the game so we can refer to it in order to make sure we've included everything that we initially intended. You won't find any code in here, just English. You can read the document from start to finish, or use the navigation in each section to jump to the relevant areas where we actually program that section. Each section below is collapsed in order to make it easy to just focus on the section you're interested in. Just click on the button below to show the content for that section.

For the most part, I think anybody reading this knows how a game of Pacman plays out. If you don't, then I would highly suggest that you stop reading this and go play a few games so you can get an idea of what we're trying to do. Like I mentioned before, my goal is not to get the most accurate representation of Pacman, but just to get something that plays similar to it. Certain rules might be different than the actual game, and the ghosts may act differently than what you may be used to. The point is that my game won't be a carbon copy of the original, but it will be really close.

Pacman is a game that takes place on a single screen. There's no scrolling, unless we're remaking Pacman Jr., which does involve horizontal scrolling. However, in this guide there will be no scrolling, all of the action will take place on a single screen. The player controls the Pacman character and can move him around the maze. The main goal of the game is to collect all of the pellets in the maze. Once the player has collected all of the pellets, the level is complete, and the game advances to the next level.

There are 4 ghosts that will make it difficult for the player to collect all of the pellets. They will chase the player in various ways and if the player comes into contact with any of the ghosts, the player will die. When the player loses all of his lives, the game is over.

There are 4 power pellets and if the player eats any of these power pellets, then the player can eat the ghosts. When the ghosts get eaten they will respawn.

There are also fruit that periodically appears in the maze the player can collect for additional points.

The following sections will explain the game in more detail.


The game starts off in a paused state. The words "Start" appear just below the ghost home. When the user is ready to start the game he presses the space bar. The spacebar will be used to pause and unpause the game at any point as well.

At the start of the game Pacman appears between two nodes. Those two nodes depend on the map being used and will be described later. Pacman also starts the game facing left.

The four ghosts start in and/or around the ghost home which is always located in the middle of the maze. Only three of the ghosts appear inside the ghost home since that's all the home can fit. Blinky starts directly above the ghost home. Inside the ghost home the ghosts are from left to right Inky, Pinky, and Clyde. When the game starts Blinky will automatically move towards the left. Pinky will immediately leave the home by moving up and then continue to the left. Inky and Clyde remain inside the home until some other conditions are met allowing them to leave. In the meantime they just bounce up and down. The initial direction for both Inky and Clyde is down.


The original Pacman game only used one maze for all of the levels. Each level just got progressively harder by tweaking certain variables. Ms. Pacman included more mazes in different colors. This game will use the original Pacman maze along with the Ms. Pacman mazes and possibly user defined mazes. However many mazes there are in the end the player advances to the next maze at the same rate as he advances through the levels. So level 1 uses maze 1, level 2 uses maze 2 and so on. When reaching the last maze the next maze will loop back to the first maze and continue from there. So, for example, if there are only three mazes, then when the player passes level 3 and proceeds to level 4, the maze being displayed will be maze 1 since there are only three mazes.

All of the Pacman mazes have portals so that the player can portal from one side of the screen to the other side of the screen. The ghosts are also able to use these portals. When the ghosts are moving towards or away from the portals their speed is reduced by half. Portals always come in pairs and are always placed on opposite sides of the screen.


This is the Pacman section.


Some boring text and so on and so forth

Some boring text and so on and so forth

Some boring text and so on and so forth

Some boring text and so on and so forth

Some boring text and so on and so forth

Some boring text and so on and so forth


There are two types of pellets: regular pellets and power pellets. Regular pellets are smaller and the exact number of them will depend on each maze. The original Pacman maze, for example, has 240 of these pellets. Power pellets are larger and each maze will only have four of these pellets usually placed in the four corners of each maze. When Pacman eats a power pellet, the ghosts enter a mode called Freight mode (described below) and are vulerable to be eaten by Pacman. When Pacman comes into contact with a ghost who is in Freight mode, Pacman receives points for eating the ghost, and then the ghost rushes back to the ghost home to respawn. The power pellets flash on and off every half of a second as well. When Pacman has eaten all of the pellets including the four power pellets, the level is complete and the player advances to the next level.


Some boring text and so on and so forth

Some boring text and so on and so forth

Some boring text and so on and so forth

Some boring text and so on and so forth

Some boring text and so on and so forth

Some boring text and so on and so forth


Some boring text and so on and so forth

Some boring text and so on and so forth

Some boring text and so on and so forth

Some boring text and so on and so forth

Some boring text and so on and so forth

Some boring text and so on and so forth


Some boring text and so on and so forth

Some boring text and so on and so forth

Some boring text and so on and so forth

Some boring text and so on and so forth

Some boring text and so on and so forth

Some boring text and so on and so forth


Some boring text and so on and so forth

Some boring text and so on and so forth

Some boring text and so on and so forth

Some boring text and so on and so forth

Some boring text and so on and so forth

Some boring text and so on and so forth


Some boring text and so on and so forth

Some boring text and so on and so forth

Some boring text and so on and so forth

Some boring text and so on and so forth

Some boring text and so on and so forth

Some boring text and so on and so forth


Pellets: 10

Power Pellets: 50

Ghost 1: 200

Ghost 2: 400

Ghost 3: 500

Ghost 4: 1600

Cherry: 100


Back Top Next