So, I'm spawning a horizontal line of enemies that I would like to have move in a nice wave. Currently I tried:
Enemy.position.X += Enemy.velocity.X;
Enemy.position.Y += -(float)Math.Cos(Enemy.position.X / 200) * 5;
This...kind of works. But the wave is not a true wave. The top and bottom of one pass are not the same (e.g. 5 for the top, and -5 for the bottom (I don't mean literal points, I just meant that it's not symmetrical)).
Is there a better way to do this? I would like the whole line to move in a wave, so it looks fluid. By that, I mean that it should look like each enemy is "following" the one in front of it. The code I posted does have this fluidity to it, but like I said, it's not a perfect wave.
Any ideas?
Thanks in advance.