Arrow Keys to move. This is a test project not a game. Feel free to remix, don't forget to like and star. How it works is shown by default, to hide it, set costume2 in the AI2 sprite's ghost effect to 100. Press space to switch between pathfinding patterns (Pattern2 is slightly more reliable). If the AI is not moving, walk into the red waves to let it have a clear scope of you. Press P to pause the raycasts, press p again to resume.
How it works: Pattern:1 Raycast is sending a projectile in every line. If it hits the player, then it tries to return. If it successfully returns, then it creates a checkpoint on the position when it hit the player. This can be seen with a target at the position of the checkpoint. -------------------------------------------------------------------------Pattern2: It does the same thing as pattern 1 except the data that it collects returns to the checkpoint not the pathfinder.