How can I make a homing attack similar to the ones of Sonic The Hedgehog?

In my game I want to make an attack that works like the homing attack. It would be activated by pressing the jump button (A in this case) after a jump. I have an animation ready for it, but I am not sure how to implement the attack.

Homing isn’t really easy to do if the enemy moves, but my game has it. Basically use proximity and player x y to ease and position. http://flowlab.io/game/play/781446

Sorry, I’m kinda new to this, could you please explain it in steps?

I mean I can’t really explain it if you don’t understand flowlab enough to get what I’m saying.

Just click on my apple character and see how I have enemy proximity x and y go into an ease with apple extracted x and y and it goes to a position. That’s really it.