This project is a recreation of the popular Fruit Ninja game, implemented in C++ with an emphasis on Object-Oriented Programming (OOP) principles. Using the SFML (Simple and Fast Multimedia Library) for graphics, this game captures the excitement of slicing fruits to score points. Players must slice as many fruits as possible while avoiding missed slices, which result in a decrease in lives. The game ends when all lives are lost.
To build and run this project, follow these steps:
-
Ensure you have the necessary dependencies installed:
- SFML library
- CMake
-
Clone the repository:
git clone https://github.com/katze-a0/simple-game-using-sfml cd (path to directory)
-
Create a build directory and navigate into it:
mkdir build cd build
-
Generate the build files using CMake: cmake ..
-
Compile the project: make
-
Run the game: ./main
- Mouse: Use the mouse to slice fruits. Click and drag to make slices.
- Gameplay: Slice as many fruits as possible to score points. Missing fruits will decrease your lives.
- Lives: The game starts with a set number of lives. The game ends when all lives are depleted.
This project uses CMake for managing the build process and SFML for rendering graphics. The CMakeLists.txt
file includes configurations to find and link the SFML library. Ensure that SFML is properly installed on your system before attempting to build the project.
This project is licensed under the MIT License - see the LICENSE file for details.