**Note before I start:** I have not actually put anything together yet, i'm still just planning, so any changes that require a shape change or anything like that are accepted.

I'm working on making a walking robot with my arduino and 3d printing all the pieces I need. It will have four legs, but since it needs to be mobile, I didn't want the power supply to be huge. I've decided it would be best if I can get each leg to only require 1 servo, at 5V each. I know how to get the leg to move back and forth, but i want to be able to lift it in between; before it brings the leg forward, it needs to lift up the foot.
The only thing I can think of is the rotation maybe locking some sort of gear.

When a motor begins rotating clockwise, how can I have it power a short motion to move an object toward itself, and when it begins moving counterclockwise to power the same object a short distance away from itself?

The servos I am using have 180\* of rotation, so they don't go all the way around in a loop.

also: don't know if it will be important or not, but because of the peculiar construction of the foot, it would be best if it was lifted straight up, rather than up at an angle, but it isn't 100% necessary. 

Are there any robots that already do this? if so, I'm unaware of them. Thanks for your time.