# you just subtract the current x position from that position, then take the absolute value and see if that's less than the allowed distance