This is the first ever project I made. I created this in CodeBlocks using C++.
I made this as I was going through my Associate's Degree at Tidewater Community College (TCC) in VA.
Before entering TCC, I knew nothing about coding. This project that I started entirely on my own helped me to solidify my understanding of class material and put it in practice.
The actual code is a little messy and could use some commenting, but the game itself works well.
For this project, I have separate files that are imported into the project as the enemies and their stats.
The player name can be anything the player wants, you can even make it a paragraph (my brother did that once).
The stats are as thus:
Attack - The amount of times the player attacks
Strength - The damage dealt with each attack
Defense - Reduced incoming damage - directly opposes Strength
Agility - Dodges incoming attacks - directly opposes Attack
Health - x5 for max health
The combat system works as thus:
Get a random number between 0 -> Player Attack
Get another random number between 0 -> Enemy Agility
Get the product of Enemy Agility - Player Attack
loop for each successful player attack
Get a random number between 0 -> Player Strength
Get another random number between 0 -> Enemy Defense
Get the product of Enemy Defense - Player Strength
total damage added up
If player doesn't land any attacks, just states DODGED!
If enemy blocks all damage, just states BLOCKED!
There are also checks so that the game doesn't crash if the player puts in a wrong input (like trying to put a char into an int variable when leveling up)