For Linux:
Make sure you have SDL library installed https://www.libsdl.org/
If you don't have it, use these commands:
sudo apt-get install libsdl2-dev
sudo apt-get install libsdl2-image-dev
sudo apt-get install libsdl2-mixer-dev
To run this program on Windows please install MSYS2 first https://www.msys2.org/
To add SDL library to MSYS2 use this command:
pacman -S mingw-w64-x86_64-{SDL2,SDL2_image,SDL2_mixer,pkg-config} make
In case of successfull installation run make and start the program with ./pacman
Game rules:
There are 240 food dots on the field. Level is finished when you eat all dots.
Use navigation arrows or A-W-D-S to move around.
There are 4 special food dots called energizers - when you eat them, ghost becomes frightened and you can eat ghost and get extra points.
2 times per level special food "fruit" appears in the game. It can give you big amount of extra points.
If a ghost catches you, you lose your life. You have 3 lifes per level. If you loose the level, you will go back to the Level 1.
Sometimes ghosts hunt you, sometimes they are just walking around. The higher is level the longer they hunt.
More information about game mechanics:
The game window is splited on tiles. The ghost catches pacman if their centers are in the same tile.
The weak place of this logic: if Pacman meets the ghost at the edge of the tile, on the next step Pacman can jump to the ghost tile, and ghost jump to the Pacman tile. That's why you should check tiles twice - after each Pacman step and after each ghost step.
Ghosts are always running to some target tile. When they walk, they run to the corner tiles. When they hunt Pacman:
- Red ghost runs to the Pacman active tile;
- Pink ghost runs to the one 4 tiles before Pacman;
- Orange ghost runs to the Pacman active tile if it's not father then 8 tiles from him;
- Cyan ghost runs to Pacman but also follows red ghost direction.
Every ghost has different lenth of "shy mode" (when it sits in the ghost house).
At Level 1 they follow the next cylce:
7 sec of walk - 20 sec of hunt - 7 sec of walk - 20 sec of hunt - 5 sec of walk - 20 sec of hunt - 5 sec of walk - forever hunt
What happens on the higher levels?
1) Walk time gets shorter;
2) Hunt time gets longer;
3) Shy mode (time in the house) gets shorter
4) Frightened more (when you can eat ghosts) gets shorter and dissapear on level 10;
5) Fruit bonus grows.
simhj316 / pacman Goto Github PK
View Code? Open in Web Editor NEWThis project forked from catidiana/pacman
Reacreation of Pac-Man classic game
License: GNU General Public License v3.0