Hello.
I haven't posted in a while as all the problems I've encountered were easily solved by just taking time and think but this one appears to be a showstopper for me.
I have a player object that collides with another object. On collision, the players stops for a designated period of time and the gesture control should take place.
What I need is give a player an ability to make any amount of tries while the player is stopped by previous condition. When time is up, the gesture control goes away and the players starts moving again.
So what I'm trying to achieve is basically a 2 nested while loops.
Pseudo code would look like this:
string gesture = "None";
while (WaitForSeconds(10))
{
while (true)
{
// Wait for the user to perform a gesture and record it
gesture = GetInputGesture();
if (gesture != "None")
break;
}
// Do some gesture comparison stuff to increase score
}
[/code:6g4mvqsa]
In addition, this code does contain a problem of a "frozen" gesture. Timed "while" loop could already end, but the nested loop can infinitely wait for the gesture. This is also the problem to solve.
Is this possible?