The Pacman Project: Game play
As a class, we came up with a collection of game play elements:
-
collecting dots
-
dots disappear when you eat them
(this requires each dot to have their ownid
related to their row and column, such asid="dot-14-23"
) - dots can increase points
- eating dots can be a two-player competition
-
dots disappear when you eat them
-
enemies can kill you
- how do you detect if you and an enemy are in the same place?
- two player game control
- AI for ghosts
-
lives
- collisions with other players/ghosts can kill you
- you may have more than one life
-
fruit
- bonus points
- random appearance
- may move around
-
power pills
- able to eat ghosts without dying
- add to score
- increase your speed
- ghosts slow down
- ghosts run
- limited time: the effects do not last forever
- ghosts strobe before the effect disappears
-
multiple ghosts control
- perhaps one player can control the ghosts
- all at once
- switching control
- random control switching
-
level advancement
- harder mazes
- faster speeds
- faster/smarter ghosts
-
impossible levels
- distorted maze
- invisible walls
- rising lava
-
board wipe
- an in-game reset of all the ghosts positions
The assignment
In addition to the user interface and motion control from your last assignment, please use complex data structures, animation, and object constructors to add game play elements to the program.
Recommendations:
- Your game play code must be inside your object constructor. Use object-oriented programming.
-
Each method should be either:
- initialization
- input
- processing
- or output
- You will need to create your mazeObject, Ms. Pacman, player two (if any), and ghost objects (if any) globally so they can be seen by all your functions.
-
Have I mentioned lately that
console.log()
commands help you debug your code a lot? Just sayin'.
Saving your work
Please save your work as "Pacman-Gameplay-LastName.html
".
Evaluation (out of 10)
- ___/1.5 — Use of object constructors with properties and methods for game play code
- ___/1.5 — Well-modularized methods with separate initialization/input/processing/output
- ___/2 — Well-commented code with good indentation, commenting (including "INIT:", ...), and style
- ___/5 — Successful implementation of five game play elements from above (the hollow circles)