How to make AI

I have no Idea how you would be able to make Akiniator, (It would probably be very complex.) However I can totally make the projectile-shooting enemy. I made a little demo.

The AI walks around randomly (The skeletons) using a path finding algorithm. When the AI finds the player it will shoot asteroids at them. Sometimes they will even say little quips. Click edit code to open the code up to see my comments and how it’s coded. Don’t worry about the “Namespace user config” at the beginning, it makes the screen bigger for the example.
Her are the extensions involved.

https://github.com/felixtsu/pxt-sight - lets the enemy see you.

https://github.com/jwunderl/arcade-tilemap-a-star - Path finding

https://github.com/jwunderl/arcade-sprite-util - utility

Let me know if this is not what you wanted.

2 Likes