'Implement AI "chase" logic

I have the following sample terrain:Stick Figure Terrain

I am new to HaxeFlixel, and trying to implement the AI chase logic. I want AI to keep track of the platforms, and jump up/down and chase/follow the Player (dynamic movements) and obeying the rules of physics, and make it realistic.

The terrain is made up of a CSV file CSV File using the following image.Terrain Image

I am stuck on how to approach the AI algorithm. How can I keep track of the location of the platforms and instruct the AI to follow the Player while staying on the platforms, and jump up/jump off when needed.

Please help!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source