If enemies only move left and right, simply make them move towards your player. If you need some intelligent enemies that can jump from platform to platform, you probably need to create some more sophisticated tile based (for example) solution using pathfinding to decide if your enemy can follow you and also make it be able to jump from ledges and so on.
“I ve searched but i can’t find a solution.”
Then polish your google-fu. Simply google for “2d platformer pathfinding” and you’ll find several examples IIRC.
Thanks @eses
Platformers in most cases require more than horizontal movement. That’s why I didn’t explicitly mentioned it. I need exactly what you ve written.
I ve searched many terms and the answers are not a complete solution. That is what I am looking for! Of course I may have missed it…
“Platformers in most cases require more than horizontal movement. T”
That might be true for the player, but there are several games where enemies pretty much move on platforms or simply fall down when trying to follow player. But of course it is a game design choice.
BTW - I remember this series, don’t remember reading it I think it was a bit too complicated for me when I found it, but you might find this helpful: