im trying to make a riddle game where your correct answers get you to the next level, but having a hard time coming up with what way to go about it any ideas would be appreciated and maybe a little sample code thanks in advance.
Maybe you've already done it, but it might be a better idea, depending on how long the game is, to just run a function that determines the level after asking each question.
I would go about having a couple of functions names of functions will be what they do in my example. A bool value that will determine if person is right. Lastly an int value for level. Also an int for difficulty.
int difficulty=1;
int lvl =1;
bool correct;
//use a srand() to randomly pick questions of a list. preferably with time and % how many questions you have.
void Riddle()
{
switch(srand())//used to pull up question
case 1:.....
cin>>answer;
//test your bool
iftrue
lvl++
}
void difficulty(int lvl)
{
if (lvl/difficulty==(whatever level you want before you raise difficulty))//this must be at an interval though so like every 5 lvl is + 1to difficulty
difficulty++;}
(type) question difficulty() //can make a function for setting an array of questions = to a difficutly
{
if difficulty ==1
return arEasy
etc etc
}
Im still knew to programming so my way might not be efficient but here is a quick idea of how I would go about writing a riddle program.