character indentifier as a variable

Started by spook1, Mon 21/11/2005 11:20:02

Previous topic - Next topic

spook1

In my game I have a set of caharcaters that should move in sync with the main character, but with an oofset.

FOLLOW_EXACTLY does not help here, sinde it does not provide the option of an offset.

I intend to make a small loop:

while (i <MaxChars)
  Char.x = cMainChar.x + Char.xoffset;
  Char.y = cMainChar.y + CHar.yoffset;
  i++;
}

Can thsi be done?? I am a bit confused by the obsoletness of a number of Charprperties.

Martin

Gilbert

Yes.
Simplest way is that when you create the characters in the editor, bear in mind that they're created as consequent entries.
Just check in the editor about their assigned range, say, #5-9, you can just access them directly using the character[] array. Like for example:

ii=5;
while (ii<=9){
character[ii].blah bla bla
Ã,  ii++;
}

SMF spam blocked by CleanTalk