The project builds a Pac-Man AI script based on a variant of Dijkstra's algorithm.
The script is written in ai.c which is based on the heuristic.
To run the project, clone the repository and compile using the make file by the command: make
The program runs by the command : ./pacman <ai/ai pause> <max/avg>
where
- level is 0-9 for standard levels, or the path to a file.dat level
- ai pause calls your algorithm and pauses the game to allow playing one step at a time.
- <max=avg> is either max or avg, to select the 2 options for propagating scores
- is an integer number indicating the budget of your search.
Okay, so basically, I got tired of enabling flash on my browser so that I could play Pacman. That, and I was extremely bored one night. So I decided to make my own Pacman... for Console.
See COPYING for details on the GNU/GPL
To make... gee... let's see. type 'make' To install... type 'make install' To run...type 'pacman [level_#]' where # is 1-9, for a premade level OR type 'pacmac [level_file_name]' for a custom level you made To uninstall... type 'make uninstall' i.e.: make && su -c "make install" pacman 3 # Start @ level 3 pacman /usr/share/pacman/Levels/level07.dat # Play only level 7 echo ":-( I don't like it." && make uninstall # Uninstall :-(
C - Pacman - That's you. & - Ghosts - Boo. . - Pellet - Yummy. Collect all of them to pass to the next level.
-
- Power pellet - Makes you invincible for a short while.
- Wall - No one can walk through it.
- Blocker - A.K.A. Ghost wall. Only the Ghosts can walk through this.
In case you don't know the rules of Pacman (rules I programmed in), here are most of them
- Pacman must collect all the pellets of food in the maze. 1 point per pellet.
- Big pellets make Pacman invincible for a short amount of time.
- If Pacman touches a ghost without being invincible, he dies and loses 1 life.
- If Pacman touches a ghost while invincible, the ghost is sent back to its starting point.
- Points are awarded for each ghost eaten in a row while invincible: 20, 40, 80, 160 (10*2^x).
- Pacman cannot go through the Ghost Walls (Blockers).
- Ghosts cannot turn completely around unless there is no other option.
- While Pacman is invincible, Ghosts will be a bit slower and tend to stay away from him.
- While Pacman is NOT invincible, Ghosts will tend to come toward him.
- Pacman starts with 3 extra lives, once all three are gone, the game is over.
- Extra lives are awarded at 1000 points, 2000, 4000, 8000... (500*2^x).
- If any character reaches a border of the maze, it will be transported to the opposite side.
- Each character can only go in one X or Y direction at a time.
To make your own levels, see Levels/README
Send comments and levels you have made to: michaelbillars@gmail.com I would love to include more levels.