I am trying to move three objects automatically, i have a function that for a given integer value moves the right object, so if i send 0 it moves object 1, 1 to move the second and 2 to move the third, it works fine when i call them separately, but when i try to call them consecutively only the last object moves and it moves three times. The code is something like that:
void mObj( int v )
{
switch (v)
{
case 0:
moves(0);
break;
case 1:
moves(1);
break;
case 2:
moves(2);
break;
case 3:
moves(0);
moves(1);
moves(2);
break;
default:
break;
}
}
The first three cases are working, the last one is not. Can anyone help? Thanks.