- Code: Select all
void SetBones(int noBones)
{
int i;
int xb;
int yb;
Bone_Cnt = 0;
for(i=1; i<noBones; i++)
{
sprintf(Bones.text, "Set Bones %i",i);
xb = rand(sizex);
if (xb > sizex - 40)
xb = sizex - 40;
if (xb < 40)
xb = 40;
yb = rand(sizey);
if (yb > sizey - 40)
yb = sizey - 40;
if (yb < 40)
yb = 40;
Actor * Bone_Cl;
Bone_Cl = getclone("Bone.0");
Bone_Cl->x=xb;
Bone_Cl->y=yb;
}
}
When I try to add the script I get the following error:
"Error Line 33: Unexpeceted declaration yb"
I did some debugging by commenting out the code working with yb "(yb = rand(sizey);" onward, and the error then relates to xb.
When I edit out the code relating to Bone_Cl "Actor * Bone_Cl;" onward - there is no error.
Any ideas??
thanks in advanced
Joncb