Welcome to the Fantasy Combat Card Game, a strategic two-player game where each player controls a hand of fantasy creatures with unique stats. Players engage in combat rounds, choosing between different combat styles like melee, ranged, or magic, and battle until one player runs out of cards.
🎥 YouTube Tutorial: How To Play
-
Card-based Combat: Each player controls a hand of fantasy creatures.
-
Combat Choices: Players can choose between melee, ranged, or magic for each attack.
-
Strategic Combat: Attack order is determined by a combination of agility, intelligence, and randomness.
-
Health-Based Elimination: Creatures are removed from play when their health reaches zero.
-
Victory Condition: A player wins when the other player runs out of cards.
-
Single-Player Mode (AI): Play against a simple AI that picks its best combat style.
-
Polished UI: Themed combat buttons, tinted Fight CTA with glow, and player-specific card selection rings.
-
New Game Button: Appears when the match ends to quickly reset and play again.
- Deal: Each player is dealt a hand of 3 unique creatures, each with its own stats (Strength, Agility, Intelligence, Defense, Magic).
- Card Selection: Players select one creature from their hand for each round.
- Combat Style: The player chooses between melee (strength), ranged (agility), or magic (magic) to attack the opponent.
- Initiative: The attack order is determined by a combination of agility, intelligence, and a random factor.
- Health: Each creature has a health pool. When a creature's health reaches zero, it is removed from the player's hand.
- Victory: The game ends when one player runs out of creatures in their hand, and the other player is declared the winner.
To get a local copy up and running, follow these simple steps:
Make sure you have Node.js installed. You can download it from here. npm (Node Package Manager) comes with Node.js.
Clone the repository:
git clone https://github.com/EdwardAThomson/fantasy-card-game.gitNavigate to the project directory:
cd fantasy-card-gameInstall the necessary dependencies:
npm installStart the development server:
npm startThe app should now be running at http://localhost:3000.
Before running tests, make sure all dependencies are installed. If you have not already run npm install (or npm ci), do so first, then run:
npm test- React: user interface.
- JavaScript (ES6+): Core logic for the game.
This project is licensed under the MIT License - see the LICENSE file for details.
I used ChatGPT (mostly 4o) to generate the original code and art. However, I eventually switch to Cursor and then Windsurf to help me with the code. There was still some human brain power used to provide the ideation and fit everything together.
