Skip to content

A Simple HearthStone Battleground clone to demonstrate OOP concepts

License

Notifications You must be signed in to change notification settings

An0n1mity/Hearthstone-Battleground-Clone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

9edd44f ยท Jan 9, 2023
Dec 15, 2022
Jan 8, 2023
Dec 9, 2022
Jan 8, 2023
Jan 8, 2023
Jan 8, 2023
Jan 7, 2023
Jan 8, 2023
Jan 8, 2023
Jan 8, 2023
Dec 10, 2022
Jan 8, 2023
Jan 8, 2023
Jan 8, 2023
Jan 8, 2023
Jan 8, 2023
Dec 6, 2022
Jan 8, 2023
Jan 8, 2023
Dec 8, 2022
Jan 8, 2023
Jan 8, 2023
Jan 8, 2023
Jan 8, 2023
Jan 8, 2023
Jan 9, 2023
Jan 7, 2023
Jan 9, 2023
Jan 8, 2023
Jan 8, 2023

Repository files navigation

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 )