# Enemy AI - Following Player and attacking

**URL:** <https://forums.solar2d.com/t/enemy-ai-following-player-and-attacking/328108>\
**Category:** Million Tile Engine\
**Created:** [August 27, 2014, 9:29pm UTC](https://forums.solar2d.com/t/enemy-ai-following-player-and-attacking/328108 "2014-08-27T21:29:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hiphopsded](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/h/46a35a/32.png) [@hiphopsded](https://forums.solar2d.com/u/hiphopsded)\
**Post date:** [August 27, 2014, 9:29pm UTC](https://forums.solar2d.com/t/enemy-ai-following-player-and-attacking/328108/1 "2014-08-27T21:29:44Z")

</div>

Hello, I am having difficulty coding an enemy AI, where the enemy follows the player and attacks him.

I don’t have any code as of yet to provide, other than what is provided when you purchase MTE.

So if anyone could provide an example that I could work with, I’d appreciate it greatly!

I’m trying to do exactly what is in this Video.

[https://www.youtube.com/watch?v=iI60voxxeQU](https://www.youtube.com/watch?v=iI60voxxeQU)

Thank you!
