I'm making an turnbased RPG and I wanted to add a traditional multiple enemy system where a user could attack different enemies when it's there turn. I started by making a list of everybody who is going to attack and having that as the turn order. My question is how do I go through that list, and for every enemy that attacks display the damage they did and wait for the user input to continue to the next enemy.
Getting it to process all the attacks is easy, but a computer will do it in milliseconds and I need it to wait for the user input to continue.
I have started the following code:
for (int i = 0; i < turnOrder.Count; i++)
{
if (turnOrder[i].isMonster)
{
ProcessEnemyChoice(enemyToAttack);
}
else if (turnOrder[i].isMonster == false)
{
ProcessUserChoice(enemyToAttack);
}
//enemyToAttack is assigned as a the enemy the user selected
}
I tried a do-while loop but that stopped my program from doing any updating, which makes sense. I'm at a loss here and any input from the geniuses here would be much appreciated.