c# – how to order entities by their distance from 0 on the x axis

I’m creating an infinite runner game in which you control several characters at once. Right now when you press the spacebar, they all jump at once but, I want them to jump at separately, one after the other from right to left(largest x to smallest x) so I need to order them in some way to represent that.

I tried using bubble sort to do this with no success so I tried my own approach where I scan the screen for the x position of the characters and assign their order to the number of passes the loop has gone through:

public void SetJumpOrder()
    {
        int pass = 0;

        foreach (Alien a in handler.aliens)
        {
            for (int i = 1000; i > 0; i--)
            {
                if (i == a.position.X) a.jumpOrder = pass;
            }
            pass++;
        }
    }

The code above didn’t work because it just gave the order of the aliens list instead. Any suggestions?