Form groups of two or three people. You should start this group activity by introducing each member of the group. You may also want to choose one person to write down the group's discussion on the provided transparency as you go so that it can be displayed on the classroom's overhead projector.
There are two parts to this activity:
finding a set of candidate objects in the 1980s video game Pac-man | |
describing instances of those objects |
For this assignment, you must think of three classes that would be used in a Pac-man program. At least one of these classes must have multiple instances in the game. For each of these object classes, describe two attributes (instance variables) and two capabilities (methods). A one line, simple description is plenty for each attribute and capability. Do not worry about details involving how the program would be implemented in a programming language. Concentrate on modeling the objects.
For those of you that do not remember Pac-man fondly from your childhood, here is a brief description: Pac-man 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.
To help you remember and visualize the game, we have provided
a screen shot of Pac-man. Look at the items in the picture. Almost anything
you see on the screen could be an object. Reread the above description
of the game. Objects are frequently nouns in the specification of the program.
If you still need help looking for objects after seeing the screen shot, try playing the game. We found a good version on the web written by Alexander Jean-Claude Bottema in Sweden.
Now, choose one of the classes you defined above that would have multiple instances
in Pac-man. Describe two instances of that class. State a possible value
for each attribute of each instance. Do the values of the attributes have
to be the same for both instances? Would the capabilities of the two instances
be the same?