Sorry had to step out for a bit. See if this helps
These are ordered on-the-fly with a "For each .. order by". If you need to store the order you might want to go back to an array.
I made a Family for the Sprites and put the 'initiative' variable on that. In my opinion ALWAYS put instance variables on a Family, not an object, for non-trivial objects.
Similarly I made a Family for the Text objects. I gave each Family an 'ID' variable so that I could associate Sprite object with Text object. Could use containers but then I'd need to do it for each Sprite object type.
Click the button and the Sprites are given an initiative as per your code, and displayed in order from highest to lowest inititative.
You do not have the required permissions to view the files attached to this post.
Last edited by codah
on Sun Feb 22, 2015 10:10 pm, edited 1 time in total.