I had create two instance of class, one who's a Character the other one is Wizard who inherit from Character. In my case you are playing as a Wizard and I was trying to automate the combat by turn.
I was wondering if it was better if make a specific class for the turn order between the Player and the A.I or am I better to go with 2 function in my Main.cpp 1 for AI turn and the other one for the Player Turn, I had already try to go with the second option; The functions, But I had no choice to make both class instance in the beginning of my main ().
I created 2 pointer that point to the respective instance of the object and I was trying to pass em by the function parameter , I'll show you my Main.cpp
The signature of the function on line 53 needs to be the same as the prototype:
Line53: void player_turn (Wizard *Luis, Character *Gerry)
Change the following:
1 2 3 4 5 6 7 8 9 10 11 12
Wizard Luis;
Character Gerry ;
Wizard* pLuis = 0; // initialize to zeroCharacter* pGerry = 0;// initialize to zeropLuis = &Luis; pGerry = &Gerry;
cout<<"You are Luis the Wizard and you are facing Gerry you Opponent"<<endl<<endl<<"What you want to do to gerry?"<<endl<<endl;
do
{
player_turn(p&Luis,p&Gerry);
I better to go with 2 function in my Main.cpp
Right now I would think you're better off with two functions. Otherwise you need to make the classes smarter...