code-kshetra / pacman-game

Automatically exported from code.google.com/p/pacman-game
1 stars 0 forks source link

Pacman Game (This is a terminal version of the classic pacman game in C++ We call it Running Scared) The player controls Pac-Man through a maze, eating pac-dots or pellets. When all dots are eaten, Pac-Man is taken to the next stage, between some stages one of three intermission animations plays. Four enemies (Blinky, Pinky, Inky and Clyde) roam the maze, trying to catch Pac-Man. If an enemy touches Pac-Man, a life is lost. When all lives have been lost, the game ends. Pac-Man is awarded a single bonus life at 10,000 points by default—DIP switches inside the machine can change the required points or disable the bonus life altogether. Near the corners of the maze are four larger, flashing dots known as power pellets that provide Pac-Man with the temporary ability to eat the enemies. The enemies turn deep blue, reverse direction and usually move more slowly. When an enemy is eaten, its eyes remain and return to the center box where it is regenerated in its normal color. Blue enemies flash white before they become dangerous again and the length of time for which the enemies remain vulnerable varies from one stage to the next, generally becoming shorter as the game progresses. In later stages, the enemies go straight to flashing, bypassing blue, although they still reverse direction when a power pellet is eaten.

Enemies North American Pac-Man title screen, showing the official enemy names. The enemies in Pac-Man are known variously as "ghosts," "Goblins," and "monsters". Despite the seemingly random nature of the enemies, their movements are strictly deterministic, which players have used to their advantage. In an interview, creator Toru Iwatani stated that he had designed each enemy with its own distinct personality in order to keep the game from becoming impossibly difficult or boring to play.26 More recently, Iwatani described the enemy behaviors in more detail at the 2011 Game Developers Conference. He stated that the red enemy chases Pac-Man, and the pink and blue enemies try to position themselves in front of Pac-Man's mouth. While he claimed that the orange enemy's behavior is random, a careful analysis of the game's code reveals that it actually chases Pac-Man most of the time, but also moves toward the lower-left corner of the maze when it gets too close to Pac-Man.