Making a Game

For those of you that do not remember Pac-man fondly from your childhood, here is a brief description: it is a game in which the user moves a yellow, chomping pie (Pac-man) around a two dimensional maze. The maze is filled with pellets that Pac-man can eat. There are also four ghosts moving around the maze, trying to catch Pac-man. If a ghost catches Pac-man, Pac-man dies. As in most video games, you can die multiple times. Pac-man typically begins with two extra lives. Fortunately, there are a few special, larger pellets that render the ghosts harmless for a short period of time (in fact, during this time, Pac-man can eat the ghosts). The user can control Pac-man with the keyboard to move him left, right, up and down. Extra points can be obtained by eating fruit (like cherries) that randomly appears for short amounts of time. Eating all the pellets on the board brings Pac-man to the next level. The goal of the game is to eat all the pellets without being killed by the ghosts. You can also try playing the game to get an understanding of how it works.

The purpose of this classwork is to get you to start thinking about the pieces that make up a game and the algorithms that make up each step of the game. I do not expect you to be able to code this game in Java until much later in the semester, but you will see that you can already pick out basic objects and algorithms from the game's description. This will typically be the first step in creating programs throughout the course.

Start by thinking of the Sprites that will be needed in the game. These are typically the graphics that you see on the game screen, plus any attributes and behaviors they might need for the game (like points, direction, etc.). A brief, one line, description is plenty for each attribute and behavior.

Next, think about how the rules of the game might be broken down into single steps that can be applied repeatedly. In particular, what happens when two Sprites interact with each other, what happens when the player presses moves the joystick (or presses a specific key), and what happens when neither of those events occur. For these algorithms, you should try to describe each step in as much detail as possible. What steps would it be useful for you to have already defined for you?