https://github.com/an0n1mity/hearthstone-battleground-clone
A Simple HearthStone Battleground clone to demonstrate OOP concepts
https://github.com/an0n1mity/hearthstone-battleground-clone
card-game hearthstone oops-in-cpp
Last synced: 9 months ago
JSON representation
A Simple HearthStone Battleground clone to demonstrate OOP concepts
- Host: GitHub
- URL: https://github.com/an0n1mity/hearthstone-battleground-clone
- Owner: An0n1mity
- License: mit
- Created: 2022-12-06T14:54:07.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-01-09T06:57:41.000Z (over 3 years ago)
- Last Synced: 2025-04-11T01:40:43.134Z (about 1 year ago)
- Topics: card-game, hearthstone, oops-in-cpp
- Language: C++
- Homepage:
- Size: 11.4 MB
- Stars: 11
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Hearthstone-Battleground-Clone-CLI
A Simple HearthStone Battleground clone to demonstrate OOP concepts
## Class diagram 📊
## Design pattern
The goal of this project was to try learn basic of design pattern for OOP using C++.
1. Uses of smart pointers : Better aggregation and composition relationship than with raw pointers.
2. Abstract classes : Polymorphism, Interfaces, Generics.
3. Factory pattern : Create cards in a flexible and modular way.
## Gameplay 🎮
Turn based game consisting of two phases : *recruitement* and *battle*.
The game end when one of the player has lost all of his HP.
* **RECRUITEMENT** :
Player can choose betwen 4 actions : buy, sell, play a card, start battle.
* **BATTLE** :
First player with most cards start the attack, minions attacking goes from left to right order and target a random enemy.
## Card effects 🪄
* **BATTLECRY** : Activate when card is played.
* **TAUNT** : Force the card to be attacked by the opponent. Activate on damage.
### Building the project 🔨
#### Clone the repo
```
git clone https://github.com/An0n1mity/Hearthstone-Battleground-Clone
```
#### Build from sources
```
g++ -o hearthstone-battle-ground-cli *.c++ (Linux)
x86_64-w64-mingw32-g++-posix -o hearthstone-battle-ground-cli -std=c++2a -lwinpthread *.cpp (Windows)
```
#### Run the binary
```
./hearthstone-battle-ground-cli
```
( An executable was already compiled for windows with mingw, you need to launch it from a terminal )