Character 'follow Me' Code And Follow Path Code

Hi,

I was wondering if anyone out there could point me in the right direction for some code samples/tutorials. The first is what I’ve called ‘follow me’ where the sprites/characters etc. will get closer to you if you stay still and try to follow you.

The second (but this might be covered with LevelHelper but what is the best way for a sprite to be put on a path and it basically follows this until you want it to stop. I guess a bit like Mario mushrooms etc. going backwards and forwards on platforms.

Thanks in anticipation.

Adam