Ok... I've looked into this quite a bit and haven't really found a solution at all.
I'm trying to achieve something along the lines of a Final Fantasy style battle system. And am not really sure how to achieve this. Here is some pseudo-code.
Determine the amount of characters on the battle field;
Start all subsequent timers -- then:
if(Player's Turn)
Display Player's options;
if(Enemy's Turn)
Run A* to determine action;
Continue timers;
if(All enemies or players are dead)
End round;
I know I'm going to need to get an array or list of all active characters in the scene and start their timers. Now, here is the part that gets me... do I need to implement a Finite State Machine or use coroutines to pause the other timers after one of the timers has filled up completely? If you guys wouldn't mind sharing some pseudo-code or pointing me in the right direction with some links/tutorials for broadening my knowledge on how to achieve this type of effect, I would greatly appreciate it. I just want to learn. Thanks ahead of time.
↧