What is the best 8 Directional Enemy AI Example?

0 favourites
  • 2 posts
From the Asset Store
Enemy turtles pack including fifteen fully animated variations
  • I've tried multiple ones found in the forum and youtube, but I was curious if anyone else found an 8 directional enemy ai consisting of player comes in view, enemy chases, stops right in front/behind of player, and attacks or player attacks before enemy can. Have you also run into problems of enemy overlapping one another and not waiting their turn to attack?

    ActionCancel on youtube has a great platform example, but I haven't been able to extend on it with 8 directional.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • What determines who attacks first? How is the turn system set up?

    In view - Use LOS behavior

    Chasing - Use a helper sprite, spawn it at the target and move it x pixels towards enemy, pathfind to helper sprite. Update position of helper sprite as needed.

    Overlapping can be a very complicated subject. One approach is to continue moving the pathfinding target helper sprite until it has a free spot, if the original target was already occupied by a pathfinder sprite. Then you add things like give instance variables to the helper sprite to keep track of the expected time of arrival, and use that for prioritizing who gets the closest spot.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)