I'm pretty sure the order is
important -- however I've also realised that the most elegant solution also utilises the loopindex of an ordered for loop.
It's not that I have two separate events, but that I have one event where the instances need to be ordered correctly on each tick: I have a number of sprite instances, and I have a list of coordinates (actually two arrays) that I'm using to adjust the positions of those instances. If the instances were re-ordered between ticks they would be given a value meant for one of the other instances and therefore jump to the wrong position. This has all nicely been solved by using an ordered for loop sorted by IID however, which should be nice reliable behaviour.
To briefly explain, I'm making a game where:
- The game is played with an overhead view, and the player character is controlled via the 8-direction movement.
- The player has 6 "turns" to accomplish a set of goals, and each turn has a fixed time-limit.
- On each subsequent turn, a "ghost player" is spawned which carries out the same actions the player took previously, so that for example on turn 3 there is one ghost for turn 1 and one ghost for turn 2.
I've got it working beautifully by recording the player's position several times per second and then lerping between those coordinates to reproduce smooth movement of the "ghost" characters.
Thanks again for your input Ashley!