I'm trying to randomly generate people that spawn every now and then and walk around. They're made of a torso which contains all the important instance variables and a bunch of other sprites hanging off (limbs, facial features) in their own family called 'BodyParts' or something.
The characters will be moving around, changing size (handled with a 'SizeScale' instance variable rather than the built-in 'Scale' parameter which wasn't really doing what I'd hoped), changing the z order and jumping between layers.
I think containers might be what I need, but I don't quite understand how they work so instead I've given everything an 'index' instance variable to show which body parts belong to which torso. I've been using this with the conditions 'if BodyParts.Index=Torso.Index and Torso.Index=BodyParts.Index', to make sure the right instances get picked. Then I'll move the sprites to where they need to be or whatever.
Anyway, it's not working. The way it assigns the index works fine, the z ordering fake-3d stuff works fine with just the torsos, but the other body parts are all over the place. Even when the conditions specify I want to pick the BodyParts with the same Index as a Torso and visa-versa, it just isn't happening. Some body parts behave and move with their parent torso, but most of them just float about ignoring the programming.
The BodyParts definitely have the same 'index' as their corresponding torso. So how do I get the conditions to pick all the right ones? Alternatively, is their some other method of getting different objects to move around like one object, including their Z order and everything?
Sorry if I'm not explaining this properly or if I'm missing something obvious.