First Battle System Any Suggestions?

Hey guys, I'm brand new to C++ (Like this is my first day) and I plan on making a simple TextRPG game and I was wondering if you guys could suggest anything I should change with this battle system :)


int PlayerHealth;
int PlayerStrength;
int EnenemyStrength;
int EnenemyHealth;


EnenemyHealth=25;
PlayerHealth=100;


while(EnenemyHealth > 0){
PlayerStrength=rand() % 10;
EnenemyHealth=EnenemyHealth-PlayerStrength;
cout<<"You Hit"<<PlayerStrength<<"\n";
cout<<"Enenemy Health "<<EnenemyHealth<<"\n\n";

EnenemyStrength=rand() % 5;
PlayerHealth=PlayerHealth-EnenemyStrength;
cout<< "Enenemy Hit "<<EnenemyStrength<<"\n";
cout<<"Your Health "<< PlayerHealth<<"\n";
Last edited on
looks fine.
If it's your first day, you might want to do other exercises before trying something like this. I know it doesn't seem like much, but a text-based RPG can quickly become very confusing.
packetpirate... lmao you're totally right. I'm doing some extremely complex stuff. I hardly know how to use the language. But at the same time it's so enriching.

If you're serious about doing && finishing this, I suggest you look at multiple source codes. Checkout sourceforge and other sites via google. I took a first look at some sources with multimedia etc and I've already learned a bunch.
Last edited on
Well, apparently the player can't die, and the damage is hard coded, but other than that, go ahead.
Topic archived. No new replies allowed.