Simple Pac-Man
In this project I was able to successfully develop and implement an artificial intelligence that would track the player's location and chase him across a map. The enemy would also enter an evade state if the player posessed a power-up.
Utilizing Finite State Machines
I was able to build this project
in about 3 days. The player
posessed 3 states which were
the 'chase', 'evade', and 'died'
states. These 3 states not only
determine the actions the
player was able to take, but
the state that the enemy was
currently in. The enemy
posessed 3 states of it's own,
which mirrored the 3 player states. These states were designed to ultimately determine the actions the player and enemy would make.
The map in this case was the simple Pac-Man board. The board was developed using a two dimensional array contained of different ASCII values for the map and orb placement. The player will then use the arrow keys to navigate around the map, but not into the walls. The 2D array also denotes the X and Y values for the player location. This allowed me to change the tile to the player icon when it was in teh corresponding location. Also it allowed me to easily determine if the tiles around the player were walls and obstructed the player's mocement.
In This project I was also able to create
power-up pills which make the enemies
vulnerable to being eaten. This power-up
would last for about 5 seconds and during
this time the enemy would run from the
player. Finally I implemented a life system
in which the player has 3 lives before the
game ends.
Click HERE to download the project





