Create a small game using C++ that has you fight one monster. Your fight must be turn based at least 5 turns. You must track your HP and the monster’s HP. After each hit you must report what both of your HP is. You must be able to apply one healing potion per turn on your character which can recover any amount you want.
Each hit to the enemy must take points off and once the monster is defeated all your points must be restored and you are declared the winner. After enemy is defeated you must also display the hit sequence and health at each turn based operation back to the screen.
Requirement breakdown:
Create a player
Create a monster
Store HP of both monster and player
Subtract HP from player
Add HP to player
Subtract HP from monster
Must be turn based (after you take a hit you deliver a hit and vice versa) up to 5 turns
Report HP of both the player and monster after each hit
Must be *able* to apply a healing potion on your turn – but are not required (must at least ask)
Each hit the enemy takes off HP (No misses when enemy attacks) and vice versa
Restore player health after enemy is defeated
Your program must contain the following:
Variables
At least one struct to hold the player or monster
Array to hold Hit Sequence (or Vector) (May need two)
Text File
Method For Removing / Adding HP
My intro to c++ professor just told us to copy stuff down, and never really taught as everything.. I've been watching tutorials online trying to catch up.
Can somebody help me finish this program? Please make it as simple as possible.. this is what I have so far.. and I have no idea how to finish it...
#include <iostream>
#include <string>
using namespace std;
struct Benedict {
int BenedictHP;
int BenedictAttack;
int BenedictDefence;
}
struct Bigfoot {
int BigfootHP;
int BigfootAttack;
int BigfootDefence;
int main() {
int BenedictHP;
int BenedictAttack;
int BenedictDefence;
int BigfootHP;
int BigfootAttack;
int BigfootDefence;
int BenedictHP = 100;
int BenedictAttack = 20;
int BenedictDefence = 10;
int BigfootHP = 100;
int BigfootAttack = 10;
int BigfootDefence = 5;
I recently did a similar code for a little text RPG I did. I took out the fight sequence for you; hopefully it helps you get an idea of how you could structure yours?