Name: Yousra Smits
Student number: 20201267
Project for the subject Advanced Programming. The project is about 'remaking' Pacman with C++ and SFML. I learn to apply the principles of object-oriented programming and software design, while also using smart pointers and the SFML library.
To install the dependencies, you can use the following command:
sudo apt-get install -y git cmake gcc g++ libsfml-dev libx11-dev libxrandr-dev libudev-dev libfreetype-dev libopenal-dev libflac-dev libvorbis-dev libxcursor-dev
Clone the repository in any way you like.
To build the project, you can use the following commands in the root of the project:
mkdir build
cd build
cmake ..
make
make install
To run the executable, you can use the following command in the root of the project:
./build/cppacman
Feature | Completed? |
---|---|
Game has a start screen | ✅ |
Game has a game screen | ✅ |
Game has a pause screen | ✅ |
Game has custom level files (*) | ✅ |
Game has a game over screen (**) | ✅ |
Simple animations | ✅ |
Display score | ✅ |
Display lives | ✅ |
Player can change direction | ✅ |
Player can move | ✅ |
Player can eat pellets | ✅ |
Player can eat enemies | ❌ |
Player can die | ❌ |
Enemies can move | ❌ |
Enemies can kill player | ❌ |
Enemies have a setup time | ❌ |
Enemies can change from state | ❌ |
- There is no smooth movement for the player. The player moves from tile to tile. This is because of the way the level is stored.
The custom level files are stored in the assets/levels
folder. With the name level{n}.lvl
and {n}
being the level
number.
The format is as follows:
- Dimensions of the level are fixed at 20x11 tiles
- Meaning of the characters:
#
: Wall.
: Pelleto
: Player/Pacman (only one per level)b
: Blinky (red ghost) (only one per level)p
: Pinky (pink ghost) (only one per level)i
: Inky (blue ghost) (only one per level)c
: Clyde (orange ghost) (only one per level)f
: Fruit (Power up) (only one per level)
- All levels must have a player, a spawn point for the ghosts, at least one pellet and all ghosts. The fruit is optional.
- Please note that the level files are case-sensitive
- If you want to change the dimensions of the levels, you can change this in "DEFINITIONS.hpp"
You can easily change to this screen by pressing "Left Alt + F2" for a loss, and "Left Alt + F3" for a win. This was done for presentation purposes. :)
- There is a SETTINGS.hpp file where you can define your preferred framerate. Currently, it is set to 165.
- DEFINITIONS.hpp contains a lot of definitions that can be changed to your liking. For example, the dimensions of the level, the size of the tiles, the size of the window, etc. Please refrain from changing these values though...
- HOWEVER, please note that changing the dimensions of the level will require you to change the level files as well.
- view/COLORS.hpp contains all the colors used in the game. You can change these to your liking. This doesnt change the colors of the sprites