Artificial intelligence through obstacles

Hi guys. It is necessary that the object itself from one edge of the map reaches the other edge. How to implement? Does the Phaser have any special tools for this?

Ps sorry for my english.

Hi Tactics,
I would suggest using the A* pathfinding algorithm. There are a few libraries which will handle the logic for you such as easystar. You can find a tutorial here.

2 Likes

Cool! Thank you .

Just want to mention that sometimes pathfinding algorithms can get CPU intensive (depends on nr of enemies and maze size), and often a simple up/down/left/right decision making routine is more than enough, especially for grid based action games.

See this pacman video which explains the ghost-algorithm. It’s the oldest trick in the book. :wink:

1 Like