Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/abdelrahman822000/pet-adoption-game

A console-based simulation game where players can adopt and take care of a virtual pet, ensuring it stays happy and healthy.
https://github.com/abdelrahman822000/pet-adoption-game

cpp pet-adoption

Last synced: 7 days ago
JSON representation

A console-based simulation game where players can adopt and take care of a virtual pet, ensuring it stays happy and healthy.

Awesome Lists containing this project

README

        

**This Project was developed by Abdelrahman Mohamed Hamad**

# Pet Adoption Game

A console-based simulation game where players can adopt and take care of a virtual pet, ensuring it stays happy and healthy.

## Table of Contents
- [Project Description](#project-description)
- [Features](#features)
- [Installation](#installation)
- [Usage](#usage)
- [License](#license)
- [Contact](#contact)

## Project Description

The Pet Adoption Game is a C++ console application that allows users to adopt a pet and take care of it by feeding and playing with it. Players can check their pet's status to monitor its hunger and happiness levels. The game ends if the pet's needs are neglected for too long.

## Features

- **Adopt a Pet:** Choose a name and start caring for your virtual pet.
- **Feed Pet:** Increase your pet's hunger level to keep it satisfied.
- **Play with Pet:** Boost your pet's happiness by playing with it.
- **Check Status:** Monitor the pet's hunger and happiness levels to ensure it stays healthy.
- **End Game:** Safely exit the game and see your pet's final status.

## Installation

### Prerequisites

- C++ Compiler (e.g., GCC, Clang, MSVC)
- CMake (Optional, for building the project)

### Steps

1. **Clone the repository:**
```bash
git clone https://github.com/Abdelrahman822000/Pet-Adoption-Game.git
cd Pet-Adoption-Game
```

2. **Build the project:**
```bash
g++ main.cpp Pet.cpp Operations.cpp -o Pet.exe
```

3. **Run the Program:**
```bash
./Pet.exe
```

## Usage

### Running the Game

1. **Start the Game:**
- After running the `Pet.exe` executable, follow the on-screen instructions to adopt a pet.
- Choose actions from the menu to feed, play with, or check the status of your pet.
- Ensure that your pet's hunger and happiness levels above critical thresholds to keep it alive.

2. **Game Operations:**
- **Adopt Pet:** Select this option to name and adopt a pet.
- **Feed Pet:** Choose this to feed the pet and increase its hunger level.
- **Play with Pet:** Use this option to play with the pet and increase its happiness level.
- **Check Status:** View the current status of your pet's hunger and happiness levels.
- **End Game:** End the game and see the final status of your pet.

### Example Output

```
Pet Adoption Game
1. Adopt Pet
2. Feed Pet
3. Play with Pet
4. Check Status
5. End Game
Choose an option: 2
You need to adopt a pet first.
1. Adopt Pet
2. Feed Pet
3. Play with Pet
4. Check Status
5. End Game
Choose an option: 1
Enter the name of your pet: Roy
Congratulations! You adopted Roy!
1. Adopt Pet
2. Feed Pet
3. Play with Pet
4. Check Status
5. End Game
Choose an option: 2
Roy has been fed.
1. Adopt Pet
2. Feed Pet
3. Play with Pet
4. Check Status
5. End Game
Choose an option: 3
Roy is playing!
1. Adopt Pet
2. Feed Pet
3. Play with Pet
4. Check Status
5. End Game
Choose an option: 4
Roy's hunger: 55
Roy's happiness: 55
1. Adopt Pet
2. Feed Pet
3. Play with Pet
4. Check Status
5. End Game
Choose an option: 5
Game Over.
Roy's hunger: 53
Roy's happiness: 53
Thank you for playing!
```

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## Contact

If you have any questions, feel free to contact me:
- **Phone:** +201028325749
- **Email:** [email protected]
- **LinkedIn:** [Abdelrahman Mohamed Hamad](https://www.linkedin.com/in/abdelrahman-mohamed-a1956b247/)