I am new to game programming and would like to implement a 2d java applet game in which a person will compete with an hero (with AI) to collect all the golds in a platform without being detected to creatures. The basic game scenario is shown in the image (without the human character included). In the game:
-There are creatures moving on their path (red line) with different speeds and moving to opposite directions
- Both the creatures and the hero (AI) will have line of sight but hero's line of sight is larger than the creatures'.
-If any of the character (human or hero(ai) ) gets into creatures' line of sight it loses.
My question is how can I make the hero collect all the golds in the map by reacting to creatures (hiding,direction changing etc.) without being detected by creatures.is it hard to implement this kind of ai? Do I also need to implement a path finding algorithm, can't I give the route to him, if so how?Can you recommend me algorithms, examples etc.?