I haven't looked deeply into the code you provided, and my understanding of arrays isn't exactly superb (I understand them, but I'm just not used to them yet), but would the method you suggested also account for moving platforms? That is, if the lead character made the jump to a moving platform, but the party character missed it slightly due to difference in timing, what would happen to the party character?
As for the code, there's a little errata in it... Get to this topic and get the fixed code from there... Sorry about that, I was typing the code from my heart and missed a little important line...
The code will simply remember the last 20 positions the player's been at, and move the ally to the 20th position of those. So it's kinda like the xprevious variable but with a longer memory. It should work fine with moving platforms as well, as long as they don't move too fast, but there's fixes for that as well (for instance, add the value of the platform's speed upwards/sideways to all array entries using a loop like this):
for(c = 0;c < 20;c += 1){
xprev[c] += platform_hspeed
yprev[c] += platform_vspeed
}
...that'd simply shift the entire memorized path along the vector the platform will move, and thus the ally will follow you flawlessly.In fact, Benjamus, it was the image in your sig that made me invent this code system (I thought that the characters followed each other in Vertex before I played it, I got jealous, and worked with getting a good method for getting that to work in my game. And when I found out... well, I'm a nice person so I wanted to show you it.)
Oh, as for music... If you can stand MIDI files, I could send you an assortment of things I've composed with a bunch of ripped music as well. You may only use the music composed by me in Vertex and not in any other project whatsoever, unless you have my written permission. Just so that you know the drill
Edited by Yal, 13 December 2010 - 01:59 PM.















