like this?
- Code: Select all
do action
wait 500 ms
do action
200 ms
do action
repeat 2 times
do action
wait 500 ms
do action
200 ms
do action
repeat 2 times
//state, loop and counter are any integers.
switch(state)
{
case 0:
//action 1;
state = 1;
counter = 0;
break;
case 1:
counter ++;
if (counter >= 15)//in frames - at 30 fps, 15 frames will be one half a sec
{
//action 2
state= 2;
counter = 0;
}
break;
case 2:
state++;
if(counter >= 6)
{
//action 3
if (loop < 2)//number of times to loop - you can use a variable
{
loop ++;
state = 0;
}
else
{
state = 3;
}
}
}
Users browsing this forum: No registered users and 1 guest